Author: jhb
Date: Fri Nov  4 22:03:41 2016
New Revision: 308322
URL: https://svnweb.freebsd.org/changeset/base/308322

Log:
  MFC 302313:
  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.

Modified:
  stable/10/sys/dev/cxgbe/t4_l2t.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/cxgbe/t4_l2t.c
==============================================================================
--- stable/10/sys/dev/cxgbe/t4_l2t.c    Fri Nov  4 21:59:27 2016        
(r308321)
+++ stable/10/sys/dev/cxgbe/t4_l2t.c    Fri Nov  4 22:03:41 2016        
(r308322)
@@ -306,7 +306,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"
@@ -315,7 +314,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);
        }
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to