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)
Sun, Oct 26, 4:25 PM
Unknown Object (File)
Wed, Oct 22, 4:41 PM
Unknown Object (File)
Mon, Oct 20, 6:59 AM
Unknown Object (File)
Sun, Oct 19, 7:15 PM
Unknown Object (File)
Sun, Oct 19, 8:13 AM
Unknown Object (File)
Fri, Oct 17, 12:11 PM
Unknown Object (File)
Fri, Oct 17, 5:10 AM
Unknown Object (File)
Sep 28 2025, 7:35 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.