Missing LLE events for ifnet and inet removals

Boris Astardzhiev boris.astardzhiev at gmail.com
Fri Apr 28 07:12:34 UTC 2017


Hello,

I've noticed that there are no lle events on ifnet and inet removals - head,
stable11, releng11. This may confuse consumers and could make their
application out of sync.

diff --git a/sys/net/if_llatbl.c b/sys/net/if_llatbl.c
index d286b6e..6807a0a 100644
--- a/sys/net/if_llatbl.c
+++ b/sys/net/if_llatbl.c
@@ -226,8 +226,10 @@ htable_prefix_free(struct lltable *llt, const struct
sockaddr *addr,
        llentries_unlink(llt, &pmd.dchain);
        IF_AFDATA_WUNLOCK(llt->llt_ifp);

-       LIST_FOREACH_SAFE(lle, &pmd.dchain, lle_chain, next)
+       LIST_FOREACH_SAFE(lle, &pmd.dchain, lle_chain, next) {
+               EVENTHANDLER_INVOKE(lle_event, lle, LLENTRY_DELETED);
                lltable_free_entry(llt, lle);
+       }
 }

This seems to fix the issue for me.

There's one minor contemplation here with this fix however.
Delete events are triggered for lle entries that were incomplete.
And since those entries had already been removed the LLE_VALID flag a few
lines upper:
        llentries_unlink(llt, &pmd.dchain);
in the consumer application entries can't be easily distinguished (valid vs
incomplete). In short - with the current fix resolve events are not
triggered
for incomplete entries but are triggered for deleted incomplete ones.
So let's go further - I could have marked the lle->la_flags with something
new
like LLE_WASVALID in the unlink function so that I could use it in the
consumer
part but I prefer to settle it into a discussion here first since there may
be
more approaches.

Best regards,
Boris


More information about the freebsd-net mailing list