summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/network/networkd-link.c12
-rw-r--r--src/network/networkd-manager.c7
-rw-r--r--src/network/networkd.h2
3 files changed, 13 insertions, 8 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 4cf34a6d94..447b2a91e6 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -391,8 +391,18 @@ int link_configure(Link *link) {
return 0;
}
-int link_update_flags(Link *link, unsigned flags) {
+int link_update(Link *link, sd_rtnl_message *m) {
+ unsigned flags;
+ int r;
+
assert(link);
+ assert(m);
+
+ r = sd_rtnl_message_link_get_flags(m, &flags);
+ if (r < 0) {
+ log_warning("Could not get link flags of '%s'", link->ifname);
+ return r;
+ }
if (link->flags & IFF_UP && !(flags & IFF_UP))
log_info("Interface '%s' is down", link->ifname);
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index 1b5837e42c..724e5e5a47 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -243,7 +243,6 @@ int manager_udev_listen(Manager *m) {
static int manager_rtnl_process_link(sd_rtnl *rtnl, sd_rtnl_message *message, void *userdata) {
Manager *m = userdata;
Link *link;
- unsigned flags;
int r, ifindex;
r = sd_rtnl_message_link_get_ifindex(message, &ifindex);
@@ -254,11 +253,7 @@ static int manager_rtnl_process_link(sd_rtnl *rtnl, sd_rtnl_message *message, vo
if (!link)
return 0;
- r = sd_rtnl_message_link_get_flags(message, &flags);
- if (r < 0)
- return 0;
-
- r = link_update_flags(link, flags);
+ r = link_update(link, message);
if (r < 0)
return 0;
diff --git a/src/network/networkd.h b/src/network/networkd.h
index 075cc1275e..d1bc348913 100644
--- a/src/network/networkd.h
+++ b/src/network/networkd.h
@@ -263,7 +263,7 @@ void link_free(Link *link);
int link_add(Manager *manager, struct udev_device *device);
int link_configure(Link *link);
-int link_update_flags(Link *link, unsigned flags);
+int link_update(Link *link, sd_rtnl_message *message);
DEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_free);
#define _cleanup_link_free_ _cleanup_(link_freep)