Author: markj
Date: Tue Apr 24 17:42:25 2018
New Revision: 332949
URL: https://svnweb.freebsd.org/changeset/base/332949

Log:
  Use dead_bpf_if instead of bp_null.
  
  This fixes a -Wunused error when DEV_BPF and NETGRAPH_BPF are not
  defined.
  
  Also remove a stray semicolon added in r332812.
  
  X-MFC with:   r332812

Modified:
  head/sys/net/bpf.c

Modified: head/sys/net/bpf.c
==============================================================================
--- head/sys/net/bpf.c  Tue Apr 24 17:37:29 2018        (r332948)
+++ head/sys/net/bpf.c  Tue Apr 24 17:42:25 2018        (r332949)
@@ -2663,7 +2663,7 @@ bpfdetach(struct ifnet *ifp)
                 */
                BPFIF_WLOCK(bp);
                bp->bif_flags |= BPFIF_FLAG_DYING;
-               *bp->bif_bpf = (struct bpf_if *)&dead_bpf_if;;
+               *bp->bif_bpf = (struct bpf_if *)&dead_bpf_if;
                BPFIF_WUNLOCK(bp);
 
                CTR4(KTR_NET, "%s: sheduling free for encap %d (%p) for if %p",
@@ -2982,13 +2982,13 @@ bpf_stats_sysctl(SYSCTL_HANDLER_ARGS)
 SYSINIT(bpfdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,bpf_drvinit,NULL);
 
 #else /* !DEV_BPF && !NETGRAPH_BPF */
+
 /*
  * NOP stubs to allow bpf-using drivers to load and function.
  *
  * A 'better' implementation would allow the core bpf functionality
  * to be loaded at runtime.
  */
-static struct bpf_if bp_null;
 
 void
 bpf_tap(struct bpf_if *bp, u_char *pkt, u_int pktlen)
@@ -3016,7 +3016,7 @@ void
 bpfattach2(struct ifnet *ifp, u_int dlt, u_int hdrlen, struct bpf_if **driverp)
 {
 
-       *driverp = &bp_null;
+       *driverp = (struct bpf_if *)&dead_bpf_if;
 }
 
 void
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to