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
Unknown Object (File)
Mon, Aug 4, 9:08 AM
Unknown Object (File)
Jun 29 2025, 7:19 PM
Unknown Object (File)
Jun 22 2025, 2:35 AM
Unknown Object (File)
Jun 18 2025, 11:24 PM
Unknown Object (File)
Jun 15 2025, 1:31 PM
Unknown Object (File)
Jun 13 2025, 12:29 PM
Unknown Object (File)
Jun 13 2025, 12:06 PM
Unknown Object (File)
Jun 13 2025, 10:01 AM
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 Skipped
Unit
Tests Skipped

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.