Hang up/down re0: <D-Link DGE-528(T) in promisc mode

Pyun YongHyeon pyunyh at gmail.com
Sat Apr 14 03:06:06 UTC 2007


On Fri, Apr 13, 2007 at 11:48:15AM +0300, Prokofiev S.P. wrote:
 > 
 > I have a problem on FreeBSD 6.2-STABLE with NIC D-Link DGE-528(T).
 > When I put interface into promiscuous mode or output by tcpdump or simply
 > ifconfig xxx promisc/ifconfig xxx -promisc, the NIC hang down and then hang 
 > up.
 > This is not normal behaviour...

Please try attached patch and let me know the result.
Thanks.
-- 
Regards,
Pyun YongHyeon
-------------- next part --------------
Index: if_re.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/re/if_re.c,v
retrieving revision 1.88
diff -u -r1.88 if_re.c
--- if_re.c	28 Mar 2007 18:07:12 -0000	1.88
+++ if_re.c	14 Apr 2007 03:03:34 -0000
@@ -2509,10 +2509,18 @@
 		break;
 	case SIOCSIFFLAGS:
 		RL_LOCK(sc);
-		if (ifp->if_flags & IFF_UP)
-			re_init_locked(sc);
-		else if (ifp->if_drv_flags & IFF_DRV_RUNNING)
-			re_stop(sc);
+		if ((ifp->if_flags & IFF_UP) != 0) {
+			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
+				if (((ifp->if_flags ^ sc->rl_if_flags)
+				    & IFF_PROMISC) != 0)
+					re_setmulti(sc);
+			} else
+				re_init_locked(sc);
+		} else {
+			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+				re_stop(sc);
+		}
+		sc->rl_if_flags = ifp->if_flags;
 		RL_UNLOCK(sc);
 		break;
 	case SIOCADDMULTI:
Index: ../../pci/if_rlreg.h
===================================================================
RCS file: /home/ncvs/src/sys/pci/if_rlreg.h,v
retrieving revision 1.64
diff -u -r1.64 if_rlreg.h
--- ../../pci/if_rlreg.h	16 Jan 2007 20:35:23 -0000	1.64
+++ ../../pci/if_rlreg.h	14 Apr 2007 03:03:35 -0000
@@ -728,6 +728,7 @@
 	uint32_t		rl_hwrev;
 	uint32_t		rl_rxlenmask;
 	int			rl_testmode;
+	int			rl_if_flags;
 	int			suspended;	/* 0 = normal  1 = suspended */
 #ifdef DEVICE_POLLING
 	int			rxcycles;


More information about the freebsd-bugs mailing list