svn commit: r302313 - head/sys/dev/cxgbe

Navdeep Parhar np at FreeBSD.org
Fri Jul 1 23:18:51 UTC 2016


Author: np
Date: Fri Jul  1 23:18:49 2016
New Revision: 302313
URL: https://svnweb.freebsd.org/changeset/base/302313

Log:
  cxgbe(4): Avoid a NULL dereference while dumping the L2 table.  Entries
  used by switching filters that rewrite L2 information do not have any
  associated ifnet.
  
  Approved by:	re@ (gjb@)
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_l2t.c

Modified: head/sys/dev/cxgbe/t4_l2t.c
==============================================================================
--- head/sys/dev/cxgbe/t4_l2t.c	Fri Jul  1 21:09:30 2016	(r302312)
+++ head/sys/dev/cxgbe/t4_l2t.c	Fri Jul  1 23:18:49 2016	(r302313)
@@ -307,7 +307,6 @@ sysctl_l2t(SYSCTL_HANDLER_ARGS)
 		}
 
 		/*
-		 * XXX: e->ifp may not be around.
 		 * XXX: IPv6 addresses may not align properly in the output.
 		 */
 		sbuf_printf(sb, "\n%4u %-15s %02x:%02x:%02x:%02x:%02x:%02x %4d"
@@ -316,7 +315,7 @@ sysctl_l2t(SYSCTL_HANDLER_ARGS)
 			   e->dmac[3], e->dmac[4], e->dmac[5],
 			   e->vlan & 0xfff, vlan_prio(e), e->lport,
 			   l2e_state(e), atomic_load_acq_int(&e->refcnt),
-			   e->ifp->if_xname);
+			   e->ifp ? e->ifp->if_xname : "-");
 skip:
 		mtx_unlock(&e->lock);
 	}


More information about the svn-src-head mailing list