]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: address - drop the 'added' flag
authorTom Gundersen <teg@jklm.no>
Tue, 10 Nov 2015 12:52:34 +0000 (13:52 +0100)
committerTom Gundersen <teg@jklm.no>
Wed, 11 Nov 2015 14:42:38 +0000 (15:42 +0100)
Instead instantiate the kernel flags to TENTATIVE until the kernel
updates us with the real value.

src/network/networkd-address.c
src/network/networkd-address.h

index 8b6acf2e1d7eee47803c0aff51fb335ab45dc04e..5231427b143997ed6aaec4d675d6a935ccbd9734 100644 (file)
@@ -248,6 +248,8 @@ static int address_add_internal(Link *link, Set **addresses,
         address->family = family;
         address->in_addr = *in_addr;
         address->prefixlen = prefixlen;
+        /* Consider address tentative until we get the real flags from the kernel */
+        address->flags = IFA_F_TENTATIVE;
 
         r = set_ensure_allocated(addresses, &address_hash_ops);
         if (r < 0)
@@ -333,7 +335,6 @@ int address_update(Address *address, unsigned char flags, unsigned char scope, s
 
         ready = address_is_ready(address);
 
-        address->added = true;
         address->flags = flags;
         address->scope = scope;
         address->cinfo = *cinfo;
@@ -769,5 +770,5 @@ int config_parse_label(const char *unit,
 bool address_is_ready(const Address *a) {
         assert(a);
 
-        return a->added && !(a->flags & (IFA_F_TENTATIVE | IFA_F_DEPRECATED));
+        return !(a->flags & (IFA_F_TENTATIVE | IFA_F_DEPRECATED));
 }
index 0b1f3b688bcb6cf91ef59c13987b11a6fe6299da..4049a23bdc4a1c923b11b38583b8fc3badb5be86 100644 (file)
@@ -52,7 +52,6 @@ struct Address {
         union in_addr_union in_addr;
         union in_addr_union in_addr_peer;
 
-        bool added:1;
         bool ip_masquerade_done:1;
 
         LIST_FIELDS(Address, addresses);