Page MenuHomeFreeBSD

VNET: do not lose if_bpf attachment on if_vmove()
ClosedPublic

Authored by bz on Apr 10 2016, 12:39 AM.
Tags
None
Referenced Files
F118235675: D5896.diff
Tue, May 27, 5:07 AM
Unknown Object (File)
Mon, May 12, 8:47 PM
Unknown Object (File)
Apr 14 2025, 6:14 AM
Unknown Object (File)
Apr 14 2025, 3:09 AM
Unknown Object (File)
Apr 14 2025, 1:36 AM
Unknown Object (File)
Apr 13 2025, 11:03 PM
Unknown Object (File)
Apr 11 2025, 8:42 AM
Unknown Object (File)
Jan 27 2025, 9:07 PM
Subscribers

Details

Summary

During if_vmove() we call if_detach_internal() which in turn calls the event handler notifying about interface departure and one of the consumers will detach if_bpf.
There is no way for us to re-attach this easily as the DLT and hdrlen are only given on interface creation.
Add a function to allow us to query the DLT and hdrlen from a current BPF attachment and after if_attach_internal() manually re-add the if_bpf attachment using these values.

Found by panics triggered by nd6 packets running past BPF_MTAP() with no proper if_bpf pointer on the interface.

Also add a basic DDB show function to investigate the if_bpf attachment of an interface.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz retitled this revision from to VNET: do not lose if_bpf attachment on if_vmove().
bz updated this object.
bz edited the test plan for this revision. (Show Details)
bz added a reviewer: gnn.
bz set the repository for this revision to rS FreeBSD src repository - subversion.
gnn edited edge metadata.
This revision is now accepted and ready to land.Apr 10 2016, 3:20 PM
This revision was automatically updated to reflect the committed changes.