Remove macros that hide access to struct ifnet fields.

This commit is contained in:
glebius 2014-09-26 13:02:29 +00:00
parent f564c3e730
commit 58a4ee184a
3 changed files with 5 additions and 7 deletions

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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) \
)