Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F172047029
D42082.id128661.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D42082.id128661.diff
View Options
diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c
--- a/sys/dev/firewire/if_fwip.c
+++ b/sys/dev/firewire/if_fwip.c
@@ -780,7 +780,7 @@
* Record the sender ID for possible BPF usage.
*/
src = ntohl(p[1]) >> 16;
- if (bpf_peers_present(if_getbpf(ifp))) {
+ if (bpf_peers_present_if(ifp)) {
mtag = m_tag_alloc(MTAG_FIREWIRE,
MTAG_FIREWIRE_SENDER_EUID,
2*sizeof(uint32_t), M_NOWAIT);
@@ -880,7 +880,7 @@
goto done;
}
- if (bpf_peers_present(if_getbpf(ifp))) {
+ if (bpf_peers_present_if(ifp)) {
/*
* Record the sender ID for possible BPF usage.
*/
diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c
--- a/sys/dev/hyperv/netvsc/if_hn.c
+++ b/sys/dev/hyperv/netvsc/if_hn.c
@@ -3262,7 +3262,7 @@
int error, send_failed = 0, has_bpf;
again:
- has_bpf = bpf_peers_present(if_getbpf(ifp));
+ has_bpf = bpf_peers_present_if(ifp);
if (has_bpf) {
/*
* Make sure that this txd and any aggregated txds are not
@@ -5972,7 +5972,7 @@
omcast = (m->m_flags & M_MCAST) != 0;
if (sc->hn_xvf_flags & HN_XVFFLAG_ACCBPF) {
- if (bpf_peers_present(if_getbpf(ifp))) {
+ if (bpf_peers_present_if(ifp)) {
m_bpf = m_copypacket(m, M_NOWAIT);
if (m_bpf == NULL) {
/*
diff --git a/sys/dev/my/if_my.c b/sys/dev/my/if_my.c
--- a/sys/dev/my/if_my.c
+++ b/sys/dev/my/if_my.c
@@ -1152,7 +1152,7 @@
* broadcast packet, multicast packet, matches our ethernet
* address or the interface is in promiscuous mode.
*/
- if (bpf_peers_present(if_getbpf(ifp))) {
+ if (bpf_peers_present_if(ifp)) {
bpf_mtap_if(ifp, m);
if (if_getflags(ifp) & IFF_PROMISC &&
(bcmp(eh->ether_dhost, if_getlladdr(sc->my_ifp),
diff --git a/sys/dev/usb/usb_pf.c b/sys/dev/usb/usb_pf.c
--- a/sys/dev/usb/usb_pf.c
+++ b/sys/dev/usb/usb_pf.c
@@ -410,7 +410,7 @@
/* sanity checks */
if (bus->ifp == NULL || if_getbpf(bus->ifp) == NULL)
return;
- if (!bpf_peers_present(if_getbpf(bus->ifp)))
+ if (!bpf_peers_present_if(bus->ifp))
return;
totlen = usbpf_xfer_precompute_size(xfer, type);
diff --git a/sys/net/bpf.h b/sys/net/bpf.h
--- a/sys/net/bpf.h
+++ b/sys/net/bpf.h
@@ -428,6 +428,7 @@
void bpfattach(struct ifnet *, u_int, u_int);
void bpfattach2(struct ifnet *, u_int, u_int, struct bpf_if **);
void bpfdetach(struct ifnet *);
+int bpf_peers_present_if(struct ifnet *);
#ifdef VIMAGE
int bpf_get_bp_params(struct bpf_if *, u_int *, u_int *);
#endif
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -2879,6 +2879,17 @@
BPF_UNLOCK();
}
+int
+bpf_peers_present_if(struct ifnet *ifp)
+{
+ struct bpf_if *bp = ifp->if_bpf;
+
+ if (bp == NULL)
+ return (0);
+
+ return (bpf_peers_present(bp));
+}
+
/*
* Get a list of available data link type of the interface.
*/
@@ -3162,6 +3173,12 @@
{
}
+int
+bpf_peers_present_if(struct ifnet *ifp)
+{
+ return (0);
+}
+
u_int
bpf_filter(const struct bpf_insn *pc, u_char *p, u_int wirelen, u_int buflen)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Sep 16, 5:26 PM (8 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39022612
Default Alt Text
D42082.id128661.diff (2 KB)
Attached To
Mode
D42082: bpf: Add IfAPI analogue for bpf_peers_present()
Attached
Detach File
Event Timeline
Log In to Comment