Subject: Re: kern/29126: tcpdump leads to packet loss
To: None <kim@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: netbsd-bugs
Date: 02/06/2005 02:29:01
The following reply was made to PR kern/29126; it has been noted by GNATS.

From: christos@zoulas.com (Christos Zoulas)
To: Kimmo Suominen <kimmo@suominen.com>, gnats-bugs@netbsd.org
Cc: Arto Selonen <arto@selonen.org>
Subject: Re: kern/29126: tcpdump leads to packet loss
Date: Sat, 5 Feb 2005 21:28:55 -0500

 On Feb 5,  7:15pm, kimmo@suominen.com (Kimmo Suominen) wrote:
 -- Subject: Re: kern/29126: tcpdump leads to packet loss
 
 | And the changes below fix ex for me...
 
 again, fix the } else and commit it.
 
 christos
 | 
 | Regards,
 | + Kim
 | -- 
 | Kimmo Suominen
 | 
 | 
 | Index: elinkxl.c
 | ===================================================================
 | RCS file: /cvsroot/src/sys/dev/ic/elinkxl.c,v
 | retrieving revision 1.75
 | diff -u -r1.75 elinkxl.c
 | --- elinkxl.c	30 Oct 2004 18:08:36 -0000	1.75
 | +++ elinkxl.c	6 Feb 2005 00:02:41 -0000
 | @@ -427,6 +427,7 @@
 |  	ifp->if_stop = ex_stop;
 |  	ifp->if_flags =
 |  	    IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST;
 | +	sc->sc_if_flags = ifp->if_flags;
 |  	IFQ_SET_READY(&ifp->if_snd);
 |  
 |  	/*
 | @@ -697,6 +698,7 @@
 |  	ifp->if_flags |= IFF_RUNNING;
 |  	ifp->if_flags &= ~IFF_OACTIVE;
 |  	ex_start(ifp);
 | +	sc->sc_if_flags = ifp->if_flags;
 |  
 |  	GO_WINDOW(1);
 |  
 | @@ -1382,7 +1384,21 @@
 |  	case SIOCGIFMEDIA:
 |  		error = ifmedia_ioctl(ifp, ifr, &sc->ex_mii.mii_media, cmd);
 |  		break;
 | -
 | +	case SIOCSIFFLAGS:
 | +		/* If the interface is up and running, only modify the receive
 | +		 * filter when setting promiscuous or debug mode.  Otherwise
 | +		 * fall through to ether_ioctl, which will reset the chip.
 | +		 */
 | +#define RESETIGN (IFF_CANTCHANGE|IFF_DEBUG)
 | +		if (((ifp->if_flags & (IFF_UP|IFF_RUNNING))
 | +		    == (IFF_UP|IFF_RUNNING))
 | +		    && ((ifp->if_flags & (~RESETIGN))
 | +		    == (sc->sc_if_flags & (~RESETIGN)))) {
 | +			ex_set_mc(sc);
 | +			error = 0;
 | +#undef RESETIGN
 | +		} else
 | +		/* FALLTHROUGH */
 |  	default:
 |  		error = ether_ioctl(ifp, cmd, data);
 |  		if (error == ENETRESET) {
 | @@ -1397,6 +1413,7 @@
 |  		break;
 |  	}
 |  
 | +	sc->sc_if_flags = ifp->if_flags;
 |  	splx(s);
 |  	return (error);
 |  }
 | @@ -1569,6 +1586,7 @@
 |  		ex_disable(sc);
 |  
 |  	ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
 | +	sc->sc_if_flags = ifp->if_flags;
 |  	ifp->if_timer = 0;
 |  }
 |  
 | Index: elinkxlvar.h
 | ===================================================================
 | RCS file: /cvsroot/src/sys/dev/ic/elinkxlvar.h,v
 | retrieving revision 1.14
 | diff -u -r1.14 elinkxlvar.h
 | --- elinkxlvar.h	5 Jun 2003 22:11:22 -0000	1.14
 | +++ elinkxlvar.h	6 Feb 2005 00:02:41 -0000
 | @@ -137,6 +137,8 @@
 |  
 |  	bus_dma_segment_t sc_useg, sc_dseg;
 |  	int sc_urseg, sc_drseg;
 | +
 | +	short sc_if_flags;
 |  };
 |  
 |  #define ex_waitcmd(sc) \
 -- End of excerpt from Kimmo Suominen