Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Apr 2007 12:05:56 +0900
From:      Pyun YongHyeon <pyunyh@gmail.com>
To:        "Prokofiev S.P." <proks@logos.uptel.net>
Cc:        freebsd-net@freebsd.org, freebsd-bugs@freebsd.org
Subject:   Re: Hang up/down re0: <D-Link DGE-528(T) in promisc mode
Message-ID:  <20070414030556.GA12777@cdnetworks.co.kr>
In-Reply-To: <20070413104122.I17217@logos.uptel.net>
References:  <20070413104122.I17217@logos.uptel.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--nFreZHaLTZJo0R7j
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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

--nFreZHaLTZJo0R7j
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="re.promisc.patch"

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;

--nFreZHaLTZJo0R7j--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070414030556.GA12777>