vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| The following patch fixes an issue with the atw(4) driver. The problem is that atw(4) attaches multiple bpf hooks and therefor tools like tcpdump and dhclient refuse to work because the wrong hook is returned -- DLT_IEEE802_11_RADIO instead of DLT_EN10MB. To fix this issue the easy way we return the most common data link type first. The most common is the one with the smallest DLT id. As we would like to have this fix in the upcomming release this needs to be tested. It needs to be tested NOW because there is not much time -- I got a deadline of 17 hours -- to get that tested and in. You do not need an atw(4) card to test the patch. Any -current system is OK. Just check that dhclient and/or tcpdump still work with all your network interfaces. As usual send good results to me and fallouts to the list. thanks in advance -- :wq Claudio Index: bpf.c ================================================== ================= RCS file: /cvs/src/sys/net/bpf.c,v retrieving revision 1.51 diff -u -p -r1.51 bpf.c --- bpf.c 22 Jun 2004 04:58:27 -0000 1.51 +++ bpf.c 11 Sep 2004 14:22:31 -0000 @@ -945,7 +945,7 @@ bpf_setif(d, ifr) struct bpf_d *d; struct ifreq *ifr; { - struct bpf_if *bp; + struct bpf_if *bp, *candidate = NULL; int s, error; /* @@ -959,6 +959,13 @@ bpf_setif(d, ifr) continue; /* * We found the requested interface. + */ + if (candidate == NULL || candidate->bif_dlt > bp->bif_dlt) + candidate = bp; + } + + if (candidate != NULL) { + /* * Allocate the packet buffers if we need to. * If we're already attached to requested interface, * just flush the buffer. @@ -969,14 +976,14 @@ bpf_setif(d, ifr) return (error); } s = splimp(); - if (bp != d->bd_bif) { + if (candidate != d->bd_bif) { if (d->bd_bif) /* * Detach if attached to something else. */ bpf_detachd(d); - bpf_attachd(d, bp); + bpf_attachd(d, candidate); } bpf_reset_d(d); splx(s); |