Page MenuHomeFreeBSD

net: on interface detach purge all its routes before detaching protocols
ClosedPublic

Authored by glebius on Jan 15 2026, 3:24 AM.
Tags
None
Referenced Files
F175204099: D54721.diff
Fri, Oct 9, 2:09 AM
Unknown Object (File)
Tue, Sep 29, 6:08 PM
Unknown Object (File)
Tue, Sep 29, 4:05 PM
Unknown Object (File)
Wed, Sep 23, 2:55 AM
Unknown Object (File)
Sun, Sep 20, 8:27 AM
Unknown Object (File)
Fri, Sep 11, 3:59 AM
Unknown Object (File)
Fri, Sep 11, 12:27 AM
Unknown Object (File)
Thu, Sep 10, 5:45 AM

Details

Summary

Otherwise, a forwarding thread may use the interface being detached. This
is a regression from 0d469d23715d, which manifests itself as a reliably
reproducible panic in in6_selecthlim(). Note that there are old bug
reports about such a panic, and I believe this change will not fix them,
as their nature is not due to a screwed up detach sequence, but due to
lack of proper epoch(9) based synchronization between the detach and
forwarding.

Reported & tested by: jhibbits
PR: 292162
Fixes: 0d469d23715d690b863787ebfa51529e1f6a9092

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I will test it with openbgp and bird.
I suspect that removing routes before detaching the actual interface might cause unexpected behavior in them.

LGTM
I also tested interface creation and destruction to advertise/withdraw its routes with bird3 (ospf) and openbgpd8.

This revision is now accepted and ready to land.Jan 16 2026, 3:01 PM