From eade13f9d21b1eb3d23dea52ccc10df16ac0d6ed Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Fri, 26 Sep 2014 13:02:29 +0000 Subject: [PATCH] Remove macros that hide access to struct ifnet fields. --- sys/net/ieee8023ad_lacp.c | 3 ++- sys/net/if_lagg.c | 4 ++-- sys/net/if_lagg.h | 5 +---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c index 97d2adfbaafd..90ed6e0ed76e 100644 --- a/sys/net/ieee8023ad_lacp.c +++ b/sys/net/ieee8023ad_lacp.c @@ -528,7 +528,8 @@ lacp_port_create(struct lagg_port *lgp) LLADDR(&sdl), ETHER_ADDR_LEN); error = if_addmulti(ifp, (struct sockaddr *)&sdl, &rifma); if (error) { - printf("%s: ADDMULTI failed on %s\n", __func__, lgp->lp_ifname); + printf("%s: ADDMULTI failed on %s\n", __func__, + lgp->lp_ifp->if_xname); return (error); } diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index 4b5e29665d60..a6e27aefdf7f 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -1541,7 +1541,7 @@ lagg_linkstate(struct lagg_softc *sc) /* Our link is considered up if at least one of our ports is active */ SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { - if (lp->lp_link_state == LINK_STATE_UP) { + if (lp->lp_ifp->if_link_state == LINK_STATE_UP) { new_link = LINK_STATE_UP; break; } @@ -1977,7 +1977,7 @@ lagg_lb_porttable(struct lagg_softc *sc, struct lagg_port *lp) return (EINVAL); if (sc->sc_ifflags & IFF_DEBUG) printf("%s: port %s at index %d\n", - sc->sc_ifname, lp_next->lp_ifname, i); + sc->sc_ifname, lp_next->lp_ifp->if_xname, i); lb->lb_ports[i++] = lp_next; } diff --git a/sys/net/if_lagg.h b/sys/net/if_lagg.h index cffc385dbf9a..1b07f7b8b858 100644 --- a/sys/net/if_lagg.h +++ b/sys/net/if_lagg.h @@ -146,11 +146,8 @@ struct lagg_reqflags { * Internal kernel part */ -#define lp_ifname lp_ifp->if_xname /* interface name */ -#define lp_link_state lp_ifp->if_link_state /* link state */ - #define LAGG_PORTACTIVE(_tp) ( \ - ((_tp)->lp_link_state == LINK_STATE_UP) && \ + ((_tp)->lp_ifp->if_link_state == LINK_STATE_UP) && \ ((_tp)->lp_ifp->if_flags & IFF_UP) \ )