I just fixed the case where autoconf and temporary addresses stayed
behind when the interface no longer has inet6 autoconf and inet6
temporary.
This deletes addresses when one removes the temporary or autoconf flag
but the other one is still set.

OK?

(This needs rev 1.82 of engine.c to work correctly)

diff --git engine.c engine.c
index 226342364e6..1e67ab11a45 100644
--- engine.c
+++ engine.c
@@ -1930,6 +1930,20 @@ update_iface_ra_prefix(struct slaacd_iface *iface, 
struct radv *ra,
 
        found = found_temporary = duplicate_found = 0;
 
+       if (!!iface->autoconf != !!iface->temporary) {
+               struct address_proposal *tmp;
+               /*
+                * if only the autoconf or temporary flag is set check if we
+                * have the "other kind" of address configured at delete it
+                */
+               LIST_FOREACH_SAFE (addr_proposal, &iface->addr_proposals,
+                   entries, tmp) {
+                       if ((!addr_proposal->temporary && !iface->autoconf) ||
+                           (addr_proposal->temporary && !iface->temporary))
+                               free_address_proposal(addr_proposal);
+               }
+       }
+
        LIST_FOREACH(addr_proposal, &iface->addr_proposals, entries) {
                if (prefix->prefix_len == addr_proposal-> prefix_len &&
                    memcmp(&prefix->prefix, &addr_proposal->prefix,



-- 
I'm not entirely sure you are real.

Reply via email to