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, Dec 30, 4:00 PM
Unknown Object (File)
Nov 29 2024, 4:33 AM
Unknown Object (File)
Oct 5 2024, 12:57 AM
Unknown Object (File)
Sep 27 2024, 2:06 PM
Unknown Object (File)
Sep 24 2024, 3:41 AM
Unknown Object (File)
Sep 23 2024, 1:43 PM
Unknown Object (File)
Sep 18 2024, 6:13 AM
Unknown Object (File)
Sep 17 2024, 2:03 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.