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
F171442834: D54721.id169918.diff
Fri, Sep 11, 3:59 AM
F171415387: D54721.id169749.diff
Fri, Sep 11, 12:27 AM
Unknown Object (File)
Thu, Sep 10, 5:45 AM
Unknown Object (File)
Tue, Sep 8, 5:33 AM
Unknown Object (File)
Mon, Sep 7, 5:10 AM
Unknown Object (File)
Sun, Sep 6, 10:52 AM
Unknown Object (File)
Sun, Sep 6, 9:27 AM
Unknown Object (File)
Sun, Sep 6, 4:31 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