|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
From 56ea854f0691e93501edb45d11625da63106b0ca Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
From: Susant Sahani <145210+ssahani@users.noreply.github.com>
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
Date: Wed, 18 Oct 2017 11:55:57 +0530
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
Subject: [PATCH] networkd: Don't stop networkd if CONFIG_FIB_RULES=n in kernel
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
(#7030)
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
If FIB Rules are not supported by the kernel then networkd fails to
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
start as it retuns error=-EOPNOTSUPP.
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
In this case just ignore and let start networkd.
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
```
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
sendto(5, {{len=28, type=RTM_GETRULE, flags=NLM_F_REQUEST|NLM_F_ACK|NLM_F_DUMP, seq=8, pid=0}, {family=AF_UNSPEC, dst_len=0, src_len=0, tos=0, table=RT_TABLE_UNSPEC, action=FR_ACT_TO_TBL, flags=0}}, 28, 0, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, 16) = 28
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
recvmsg(5, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=128->12, msg_iov=[{iov_base=NULL, iov_len=0}], msg_iovlen=1, msg_control=[{cmsg_len=20, cmsg_level=SOL_NETLINK, cmsg_type=0x3}], msg_controllen=24, msg_flags=MSG_TRUNC}, MSG_PEEK|MSG_TRUNC) = 48
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
recvmsg(5, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=128->12, msg_iov=[{iov_base={{len=48, type=NLMSG_ERROR, flags=0, seq=8, pid=8856}, {error=-EOPNOTSUPP, msg={{len=28, type=RTM_GETRULE, flags=NLM_F_REQUEST|NLM_F_ACK|NLM_F_DUMP, seq=8, pid=0}, {family=AF_UNSPEC, dst_len=0, src_len=0, tos=0, table=RT_TABLE_UNSPEC, action=FR_ACT_TO_TBL, flags=0}}}}, iov_len=7416}], msg_iovlen=1, msg_control=[{cmsg_len=20, cmsg_level=SOL_NETLINK, cmsg_type=0x3}], msg_controllen=24, msg_flags=0}, MSG_TRUNC) = 48
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
```
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
```
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
Oct 08 10:22:24 naomi systemd[1]: Starting Network Service...
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
Oct 08 10:22:24 naomi systemd-networkd[983]: Could not enumerate rules: Operation not supported
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
Oct 08 10:22:24 naomi systemd[1]: systemd-networkd.service: Main process exited, code=exited, status=1/FAILURE
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
```
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
Fixes
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
(cherry picked from commit 6acbbdd4da2d072112042abbce8c0a9523beed4e)
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
src/network/networkd-manager.c | 8 +++++++-
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
diff
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
index 71445d5dda..200d0f622d 100644
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
@@ -1454,8 +1454,14 @@ int manager_rtnl_enumerate_rules(Manager *m) {
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
r = sd_netlink_call(m->rtnl, req, 0, &reply);
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
- if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
+ if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
+ if (r == -EOPNOTSUPP) {
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
+ log_debug("FIB Rules are not supported by the kernel. Ignoring.");
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
+ return 0;
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
+ }
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
+ }
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
for (rule = reply; rule; rule = sd_netlink_message_next(rule)) {
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
int k;
|