chiark / gitweb /
sd-rtnl: link - allow setting the change mask
authorTom Gundersen <teg@jklm.no>
Tue, 21 Jan 2014 14:20:42 +0000 (15:20 +0100)
committerTom Gundersen <teg@jklm.no>
Wed, 22 Jan 2014 16:56:49 +0000 (17:56 +0100)
src/core/loopback-setup.c
src/libsystemd/sd-rtnl/rtnl-message.c
src/network/networkd-link.c
src/systemd/sd-rtnl.h

index ffe661a..7eb28fc 100644 (file)
@@ -95,7 +95,7 @@ static int start_interface(sd_rtnl *rtnl, int if_loopback, struct in_addr *ipv4_
         if (r < 0)
                 return r;
 
-        r = sd_rtnl_message_link_set_flags(req, IFF_UP);
+        r = sd_rtnl_message_link_set_flags(req, IFF_UP, IFF_UP);
         if (r < 0)
                 return r;
 
index 984115c..af8f8cf 100644 (file)
@@ -167,13 +167,16 @@ int sd_rtnl_message_route_new(uint16_t nlmsg_type, unsigned char rtm_family,
         return 0;
 }
 
-int sd_rtnl_message_link_set_flags(sd_rtnl_message *m, unsigned flags) {
+int sd_rtnl_message_link_set_flags(sd_rtnl_message *m, unsigned flags, unsigned change) {
         struct ifinfomsg *ifi;
 
         ifi = NLMSG_DATA(m->hdr);
 
         ifi->ifi_flags = flags;
-        ifi->ifi_change = 0xffffffff;
+        if (change)
+                ifi->ifi_change = change;
+        else
+                ifi->ifi_change = 0xffffffff;
 
         return 0;
 }
index f1c2889..2fa77f1 100644 (file)
@@ -713,7 +713,7 @@ static int link_up(Link *link) {
                 return r;
         }
 
-        r = sd_rtnl_message_link_set_flags(req, IFF_UP);
+        r = sd_rtnl_message_link_set_flags(req, IFF_UP, IFF_UP);
         if (r < 0) {
                 log_error_link(link, "Could not set link flags: %s", strerror(-r));
                 return r;
index 7d626b8..0feb8c6 100644 (file)
@@ -84,7 +84,7 @@ sd_rtnl_message *sd_rtnl_message_unref(sd_rtnl_message *m);
 int sd_rtnl_message_get_errno(sd_rtnl_message *m);
 int sd_rtnl_message_get_type(sd_rtnl_message *m, uint16_t *type);
 
-int sd_rtnl_message_link_set_flags(sd_rtnl_message *m, unsigned flags);
+int sd_rtnl_message_link_set_flags(sd_rtnl_message *m, unsigned flags, unsigned change);
 int sd_rtnl_message_link_set_type(sd_rtnl_message *m, unsigned type);
 int sd_rtnl_message_link_get_ifindex(sd_rtnl_message *m, int *ifindex);
 int sd_rtnl_message_link_get_flags(sd_rtnl_message *m, unsigned *flags);