this basically reverts bpf.c r1.117.

two reasons. firstly, nothing uses the ioctls. the tcpdump -Q support
never materialised.

secondly, and probably more importantly, the implementation assumes
that bpf handles mbufs with pkthdrs in the first mbuf, but that is
incorrect. bpf actually only deals with chains of data (so m_data,
m_len, m_next), so this could blow up if anyone actually uses it.

ok?

Index: bpf.c
===================================================================
RCS file: /cvs/src/sys/net/bpf.c,v
retrieving revision 1.136
diff -u -p -r1.136 bpf.c
--- bpf.c       29 Mar 2016 10:38:27 -0000      1.136
+++ bpf.c       30 Mar 2016 00:12:41 -0000
@@ -859,14 +859,6 @@ bpfioctl(dev_t dev, u_long cmd, caddr_t 
                    (BPF_DIRECTION_IN|BPF_DIRECTION_OUT);
                break;
 
-       case BIOCGQUEUE:        /* get queue */
-               *(u_int *)addr = d->bd_queue;
-               break;
-
-       case BIOCSQUEUE:        /* set queue */
-               d->bd_queue = *(u_int *)addr;
-               break;
-
        case FIONBIO:           /* Non-blocking I/O */
                if (*(int *)addr)
                        d->bd_rtout = -1;
@@ -1244,8 +1236,6 @@ _bpf_mtap(caddr_t arg, struct mbuf *m, u
                atomic_inc_long(&d->bd_rcount);
 
                if ((direction & d->bd_dirfilt) != 0)
-                       slen = 0;
-               else if (d->bd_queue && m->m_pkthdr.pf.qid != d->bd_queue)
                        slen = 0;
                else {
                        struct bpf_program *bf;
Index: bpfdesc.h
===================================================================
RCS file: /cvs/src/sys/net/bpfdesc.h,v
retrieving revision 1.29
diff -u -p -r1.29 bpfdesc.h
--- bpfdesc.h   3 Dec 2015 16:27:32 -0000       1.29
+++ bpfdesc.h   30 Mar 2016 00:12:41 -0000
@@ -80,7 +80,6 @@ struct bpf_d {
        u_char          bd_locked;      /* true if descriptor is locked */
        u_char          bd_fildrop;     /* true if filtered packets will be 
dropped */
        u_char          bd_dirfilt;     /* direction filter */
-       u_int           bd_queue;       /* the queue the user wants to watch (0 
== all) */
        int             bd_hdrcmplt;    /* false to fill in src lladdr 
automatically */
        int             bd_async;       /* non-zero if packet reception should 
generate signal */
        int             bd_sig;         /* signal to send upon packet reception 
*/

Reply via email to