Author: jkim
Date: Fri Jun  1 17:17:46 2012
New Revision: 236410
URL: http://svn.freebsd.org/changeset/base/236410

Log:
  MFC:  r236251
  
  Fix 32-bit shim for BIOCSETF to drop all packets buffered on the descriptor
  and reset statistics as it should.

Modified:
  stable/9/sys/net/bpf.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/net/bpf.c
==============================================================================
--- stable/9/sys/net/bpf.c      Fri Jun  1 17:07:52 2012        (r236409)
+++ stable/9/sys/net/bpf.c      Fri Jun  1 17:17:46 2012        (r236410)
@@ -1531,13 +1531,23 @@ bpf_setf(struct bpf_d *d, struct bpf_pro
        struct bpf_program32 *fp32;
        struct bpf_program fp_swab;
 
-       if (cmd == BIOCSETWF32 || cmd == BIOCSETF32 || cmd == BIOCSETFNR32) {
+       switch (cmd) {
+       case BIOCSETF32:
+       case BIOCSETWF32:
+       case BIOCSETFNR32:
                fp32 = (struct bpf_program32 *)fp;
                fp_swab.bf_len = fp32->bf_len;
                fp_swab.bf_insns = (struct bpf_insn *)(uintptr_t)fp32->bf_insns;
                fp = &fp_swab;
-               if (cmd == BIOCSETWF32)
+               switch (cmd) {
+               case BIOCSETF32:
+                       cmd = BIOCSETF;
+                       break;
+               case BIOCSETWF32:
                        cmd = BIOCSETWF;
+                       break;
+               }
+               break;
        }
 #endif
        if (cmd == BIOCSETWF) {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to