diff options
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkctl.c | 6 | ||||
-rw-r--r-- | src/network/networkd-manager.c | 4 | ||||
-rw-r--r-- | src/network/networkd-netdev-bond.c | 5 | ||||
-rw-r--r-- | src/network/networkd-netdev-ipvlan.c | 10 | ||||
-rw-r--r-- | src/network/networkd-netdev-macvlan.c | 10 | ||||
-rw-r--r-- | src/network/networkd-wait-online-manager.c | 2 |
6 files changed, 15 insertions, 22 deletions
diff --git a/src/network/networkctl.c b/src/network/networkctl.c index 68925debe6..8e20f70aae 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -199,7 +199,7 @@ static int list_links(int argc, char *argv[], void *userdata) { pager_open_if_enabled(); - r = sd_rtnl_open(&rtnl, 0); + r = sd_rtnl_open(&rtnl); if (r < 0) return log_error_errno(r, "Failed to connect to netlink: %m"); @@ -670,7 +670,7 @@ static int link_status(int argc, char *argv[], void *userdata) { char **name; int r; - r = sd_rtnl_open(&rtnl, 0); + r = sd_rtnl_open(&rtnl); if (r < 0) return log_error_errno(r, "Failed to connect to netlink: %m"); @@ -910,7 +910,7 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) { pager_open_if_enabled(); - r = sd_rtnl_open(&rtnl, 0); + r = sd_rtnl_open(&rtnl); if (r < 0) return log_error_errno(r, "Failed to connect to netlink: %m"); diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index db737ad484..9936a8e7cd 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -385,9 +385,9 @@ static int manager_connect_rtnl(Manager *m) { fd = systemd_netlink_fd(); if (fd < 0) - r = sd_rtnl_open(&m->rtnl, 3, RTNLGRP_LINK, RTNLGRP_IPV4_IFADDR, RTNLGRP_IPV6_IFADDR); + r = sd_rtnl_open(&m->rtnl); else - r = sd_rtnl_open_fd(&m->rtnl, fd, 0); + r = sd_rtnl_open_fd(&m->rtnl, fd); if (r < 0) return r; diff --git a/src/network/networkd-netdev-bond.c b/src/network/networkd-netdev-bond.c index 9919955f51..d7f9bb4f8e 100644 --- a/src/network/networkd-netdev-bond.c +++ b/src/network/networkd-netdev-bond.c @@ -242,7 +242,7 @@ static int netdev_bond_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_m } if (b->ad_select != _NETDEV_BOND_AD_SELECT_INVALID && - b->mode == BOND_MODE_8023AD) { + b->mode == NETDEV_BOND_MODE_802_3AD) { r = sd_rtnl_message_append_u8(m, IFLA_BOND_AD_SELECT, b->ad_select); if (r < 0) return log_netdev_error_errno(netdev, r, "Could not append IFLA_BOND_AD_SELECT attribute: %m"); @@ -279,7 +279,8 @@ static int netdev_bond_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_m return log_netdev_error_errno(netdev, r, "Could not append IFLA_BOND_RESEND_IGMP attribute: %m"); } - if (b->packets_per_slave <= PACKETS_PER_SLAVE_MAX) { + if (b->packets_per_slave <= PACKETS_PER_SLAVE_MAX && + b->mode == NETDEV_BOND_MODE_BALANCE_RR) { r = sd_rtnl_message_append_u32(m, IFLA_BOND_PACKETS_PER_SLAVE, b->packets_per_slave); if (r < 0) return log_netdev_error_errno(netdev, r, "Could not append IFLA_BOND_PACKETS_PER_SLAVE attribute: %m"); diff --git a/src/network/networkd-netdev-ipvlan.c b/src/network/networkd-netdev-ipvlan.c index 5189000c1f..f1c8e0ccdb 100644 --- a/src/network/networkd-netdev-ipvlan.c +++ b/src/network/networkd-netdev-ipvlan.c @@ -42,13 +42,9 @@ static int netdev_ipvlan_fill_message_create(NetDev *netdev, Link *link, sd_rtnl assert(netdev->ifname); if (m->mode != _NETDEV_IPVLAN_MODE_INVALID) { - r = sd_rtnl_message_append_u16(req, IFLA_IPVLAN_MODE, m->mode); - if (r < 0) { - log_netdev_error(netdev, - "Could not append IFLA_IPVLAN_MODE attribute: %s", - strerror(-r)); - return r; - } + r = sd_rtnl_message_append_u16(req, IFLA_IPVLAN_MODE, m->mode); + if (r < 0) + return log_netdev_error_errno(netdev, r, "Could not append IFLA_IPVLAN_MODE attribute: %m"); } return 0; diff --git a/src/network/networkd-netdev-macvlan.c b/src/network/networkd-netdev-macvlan.c index 5f41f1c865..a8bf6e6bb7 100644 --- a/src/network/networkd-netdev-macvlan.c +++ b/src/network/networkd-netdev-macvlan.c @@ -44,13 +44,9 @@ static int netdev_macvlan_fill_message_create(NetDev *netdev, Link *link, sd_rtn assert(netdev->ifname); if (m->mode != _NETDEV_MACVLAN_MODE_INVALID) { - r = sd_rtnl_message_append_u32(req, IFLA_MACVLAN_MODE, m->mode); - if (r < 0) { - log_netdev_error(netdev, - "Could not append IFLA_MACVLAN_MODE attribute: %s", - strerror(-r)); - return r; - } + r = sd_rtnl_message_append_u32(req, IFLA_MACVLAN_MODE, m->mode); + if (r < 0) + return log_netdev_error_errno(netdev, r, "Could not append IFLA_MACVLAN_MODE attribute: %m"); } return 0; diff --git a/src/network/networkd-wait-online-manager.c b/src/network/networkd-wait-online-manager.c index 1c997a50a4..39f3845633 100644 --- a/src/network/networkd-wait-online-manager.c +++ b/src/network/networkd-wait-online-manager.c @@ -177,7 +177,7 @@ static int manager_rtnl_listen(Manager *m) { assert(m); /* First, subscribe to interfaces coming and going */ - r = sd_rtnl_open(&m->rtnl, 3, RTNLGRP_LINK, RTNLGRP_IPV4_IFADDR, RTNLGRP_IPV6_IFADDR); + r = sd_rtnl_open(&m->rtnl); if (r < 0) return r; |