net: on interface detach purge multicast addresses after protocols

We first want to give a chance to all owners of multicast addresses to
free them and only then run through the list of remaining ones.  It might
be that no addresses remain there normally, but this needs to be analyzed
deeper.  For now restore the sequence that was before 0d469d2371 to fix
a possible use after free.

Fixes:	0d469d2371
This commit is contained in:
Gleb Smirnoff
2025-12-21 10:56:00 -08:00
parent 0e724de9ed
commit 77939d64f2
+1 -2
View File
@@ -1117,9 +1117,8 @@ if_detach_internal(struct ifnet *ifp, bool vmove)
#endif
if_purgeaddrs(ifp);
if_purgemaddrs(ifp);
EVENTHANDLER_INVOKE(ifnet_departure_event, ifp);
if_purgemaddrs(ifp);
if (IS_DEFAULT_VNET(curvnet))
devctl_notify("IFNET", ifp->if_xname, "DETACH", NULL);