HomeFreeBSD

bpf: Add IfAPI analogue for bpf_peers_present()

Description

bpf: Add IfAPI analogue for bpf_peers_present()

An interface's bpf could feasibly not exist, in which case
bpf_peers_present() would panic from a NULL pointer dereference. Solve
this by adding a new IfAPI that could deal with a NULL bpf, if such
could occur in the network stack.

Reviewed by: zlei
Sponsored by: Juniper Networks, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42082

(cherry picked from commit 8f31b879ecaf9e738dba631df4606742ee404e8e)

bpf: Prefer the boolean form when calling bpf_peers_present()

Reviewed by: markj, kp, network
MFC with: 8f31b879ecaf
Differential Revision: https://reviews.freebsd.org/D45509

(cherry picked from commit 89204d9dcbe28558fae65936a0e93f44d926b88f)

Details

Provenance
jhibbitsAuthored on Oct 4 2023, 8:56 PM
zleiCommitted on Tue, Sep 24, 4:30 AM
Reviewer
network
Differential Revision
D42082: bpf: Add IfAPI analogue for bpf_peers_present()
Parents
rGc5a9d5ff0c0c: pf: use AF_INET6 when comparing IPv6 addresses
Branches
Unknown
Tags
Unknown