From 935ca1ae7c503c47609803e62c51ac7dc03493bf Mon Sep 17 00:00:00 2001 From: Sean Bruno Date: Mon, 27 Mar 2017 15:08:02 +0000 Subject: [PATCH] Access *correct* ifp data structure when debug sysctl is invoked. Submitted by: Kevin Bowling Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D10126 --- sys/dev/e1000/if_em.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index a1928760d48..f729ad6115a 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -4341,16 +4341,17 @@ em_if_debug(if_ctx_t ctx) static void em_print_debug_info(struct adapter *adapter) { - device_t dev = adapter->dev; + device_t dev = iflib_get_dev(adapter->ctx); + struct ifnet *ifp = iflib_get_ifp(adapter->ctx); struct tx_ring *txr = &adapter->tx_queues->txr; struct rx_ring *rxr = &adapter->rx_queues->rxr; - if (if_getdrvflags(adapter->ifp) & IFF_DRV_RUNNING) + if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) printf("Interface is RUNNING "); else printf("Interface is NOT RUNNING\n"); - if (if_getdrvflags(adapter->ifp) & IFF_DRV_OACTIVE) + if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE) printf("and INACTIVE\n"); else printf("and ACTIVE\n");