Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Jun 2016 09:34:49 GMT
From:      vincenzo@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r305580 - soc2016/vincenzo/head/sys/dev/netmap
Message-ID:  <201606270934.u5R9Ynfj028703@socsvn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: vincenzo
Date: Mon Jun 27 09:34:49 2016
New Revision: 305580
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=305580

Log:
   freebsd: ptnet_transmit: check for IFF_DRV_RUNNING bit

Modified:
  soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c

Modified: soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c
==============================================================================
--- soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c	Mon Jun 27 09:34:39 2016	(r305579)
+++ soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c	Mon Jun 27 09:34:49 2016	(r305580)
@@ -856,6 +856,11 @@
 		}
 	}
 
+	if (unlikely(!(ifp->if_drv_flags & IFF_DRV_RUNNING))) {
+		RD(1, "Interface is down");
+		return ENETDOWN;
+	}
+
 	if (!PTNET_Q_TRYLOCK(pq)) {
 		/* We failed to acquire the lock, schedule the taskqueue. */
 		RD(1, "Deferring TX work");
@@ -998,10 +1003,10 @@
 	struct ifmedia *ifm = &sc->media;
 
 	if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) {
-		return (EINVAL);
+		return EINVAL;
 	}
 
-	return (0);
+	return 0;
 }
 
 



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