[systemd-commits] src/network

Tom Gundersen tomegun at kemper.freedesktop.org
Tue Aug 19 10:01:45 PDT 2014


 src/network/networkd-link.c |   10 ++++++++++
 src/network/networkd.h      |    1 +
 2 files changed, 11 insertions(+)

New commits:
commit 81163121e649523b4071f67ddc03c2db649036c5
Author: Tom Gundersen <teg at jklm.no>
Date:   Tue Aug 19 18:59:28 2014 +0200

    networkd: don't consider deprecated or tentative addresses when determining operstate
    
    https://bugs.freedesktop.org/show_bug.cgi?id=81287

diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index b5f5863..dff3270 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1386,6 +1386,13 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message,
                 return 0;
         }
 
+        r = sd_rtnl_message_addr_get_flags(message, &address->flags);
+        if (r < 0) {
+                log_warning_link(link,
+                                 "rtnl: received address with invalid flags, ignoring");
+                return 0;
+        }
+
         switch (address->family) {
         case AF_INET:
                 r = sd_rtnl_message_read_in_addr(message, IFA_LOCAL,
@@ -1658,6 +1665,9 @@ static void link_update_operstate(Link *link) {
 
                 /* if we have carrier, check what addresses we have */
                 LIST_FOREACH(addresses, address, link->addresses) {
+                        if (address->flags & (IFA_F_TENTATIVE | IFA_F_DEPRECATED))
+                                continue;
+
                         if (address->scope < scope)
                                 scope = address->scope;
                 }
diff --git a/src/network/networkd.h b/src/network/networkd.h
index c8d89d2..ab5df1a 100644
--- a/src/network/networkd.h
+++ b/src/network/networkd.h
@@ -126,6 +126,7 @@ struct Address {
         int family;
         unsigned char prefixlen;
         unsigned char scope;
+        unsigned char flags;
         char *label;
 
         struct in_addr broadcast;



More information about the systemd-commits mailing list