Re: slaacd(8): delete autoconf or temporary address on interface flag removal

2022-07-23 Thread Klemens Nanni
On Sat, Jul 23, 2022 at 11:06:13AM +0200, Florian Obser wrote:
> 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 kn



slaacd(8): delete autoconf or temporary address on interface flag removal

2022-07-23 Thread Florian Obser
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, >addr_proposals,
+   entries, tmp) {
+   if ((!addr_proposal->temporary && !iface->autoconf) ||
+   (addr_proposal->temporary && !iface->temporary))
+   free_address_proposal(addr_proposal);
+   }
+   }
+
LIST_FOREACH(addr_proposal, >addr_proposals, entries) {
if (prefix->prefix_len == addr_proposal-> prefix_len &&
memcmp(>prefix, _proposal->prefix,



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