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, Apr 28, 3:12 PM
Unknown Object (File)
Sun, Apr 28, 2:59 PM
Unknown Object (File)
Thu, Apr 25, 12:00 PM
Unknown Object (File)
Thu, Apr 25, 11:17 AM
Unknown Object (File)
Feb 15 2024, 10:33 AM
Unknown Object (File)
Jan 5 2024, 4:11 PM
Unknown Object (File)
Dec 20 2023, 5:18 AM
Unknown Object (File)
Oct 27 2023, 4:29 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.