On Tue, Jul 09, 2013 at 02:05:30PM +0000, dcx dcy wrote:
> Hi all, 
> 
>          I am having an issue where my hme0 interface is always turning up 
> and down with dhclient requesting a lease.
> 
>  
> 
> I am thinking this could be the same issue described by Jeremy Chadwick on 
> June 9th:
> 
> http://lists.freebsd.org/pipermail/freebsd-stable/2013-June/073711.html
> 
>  
> 
> Everything was fine on 8.2-STABLE and older versions.  
> 
>  
> 
> It was then upgraded directly to 9.0-STABLE and this is where I started 
> having issues­.
> 
>  
> 
> I am currently running 9.1-STABLE (July 7th) and issue persists.
> 
>  
> 
> This is a Sun Netra T1 acting as my home gateway, hme0 is connected to a 
> Cisco switch. 
> 
> I am normally using DHCP to get an ip from my ISP.  
> 
>  
> 
> For now, the only way it works is to set a static ip  (I tried different 
> dhclient options ... sync, etc).
> 
>  
> 
> hme1 and ath0 (AR5413) is serving internal network.
> 

Try attached patch and let me know whether it makes any difference
for you.
Index: sys/dev/hme/if_hme.c
===================================================================
--- sys/dev/hme/if_hme.c	(revision 253125)
+++ sys/dev/hme/if_hme.c	(working copy)
@@ -742,6 +742,10 @@ hme_init_locked(struct hme_softc *sc)
 	u_int32_t n, v;
 
 	HME_LOCK_ASSERT(sc, MA_OWNED);
+
+	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+		return;
+
 	/*
 	 * Initialization sequence. The numbered steps below correspond
 	 * to the sequence outlined in section 6.3.5.1 in the Ethernet
@@ -1324,6 +1328,7 @@ hme_eint(struct hme_softc *sc, u_int status)
 	/* check for fatal errors that needs reset to unfreeze DMA engine */
 	if ((status & HME_SEB_STAT_FATAL_ERRORS) != 0) {
 		HME_WHINE(sc->sc_dev, "error signaled, status=%#x\n", status);
+		sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 		hme_init_locked(sc);
 	}
 }
@@ -1370,6 +1375,7 @@ hme_watchdog(struct hme_softc *sc)
 		device_printf(sc->sc_dev, "device timeout (no link)\n");
 	++ifp->if_oerrors;
 
+	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 	hme_init_locked(sc);
 	hme_start_locked(ifp);
 	return (EJUSTRETURN);
_______________________________________________
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Reply via email to