NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/50456: alc - packet loose when tcpdump



The following reply was made to PR kern/50456; it has been noted by GNATS.

From: Freddy DISSAUX <freddy.dsx%free.fr@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/50456: alc - packet loose when tcpdump
Date: Tue, 24 Nov 2015 21:00:05 +0100

 After applying this patch based on OpenBSD, my interface don't loose
 packets when i run tcpdump:
 
 --- sys/dev/pci/if_alc.c.orig   Sun Nov 15 11:48:15 2015
 +++ sys/dev/pci/if_alc.c        Sat Nov 21 11:37:49 2015
 @@ -2034,11 +2034,41 @@
  alc_ioctl(struct ifnet *ifp, u_long cmd, void *data)
  {
         struct alc_softc *sc = ifp->if_softc;
 +       struct mii_data *mii = &sc->sc_miibus;
 +       struct ifreq *ifr = (struct ifreq *)data;
         int s, error = 0;
  
         s = splnet();
  
 -       error = ether_ioctl(ifp, cmd, data);
 +       switch (cmd) {
 +       case SIOCSIFADDR:
 +               ifp->if_flags |= IFF_UP;
 +               if (!(ifp->if_flags & IFF_RUNNING))
 +                       alc_init(ifp);
 +               break;
 +
 +       case SIOCSIFFLAGS:
 +               if (ifp->if_flags & IFF_UP) {
 +                       if (ifp->if_flags & IFF_RUNNING)
 +                               error = ENETRESET;
 +                       else
 +                               alc_init(ifp);
 +               } else {
 +                       if (ifp->if_flags & IFF_RUNNING)
 +                               alc_stop(ifp, 0);
 +               }
 +               break;
 +
 +       case SIOCSIFMEDIA:
 +       case SIOCGIFMEDIA:
 +               error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, cmd);
 +               break;
 +
 +       default:
 +               error = ether_ioctl(ifp, cmd, data);
 +               break;
 +       }
 +
         if (error == ENETRESET) {
                 if (ifp->if_flags & IFF_RUNNING)
                         alc_iff(sc);
 
 Regards.
 


Home | Main Index | Thread Index | Old Index