From 3b627506255c1d92257a6c7e55e8adb4231a9992 Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Tue, 27 Oct 2015 10:52:19 +0000 Subject: Use rt_ifidx rather than rt_ifp. ok bluhm@ --- sys/net/if.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'sys/net/if.c') diff --git a/sys/net/if.c b/sys/net/if.c index 66cc8b9e19f..e433dcf9dba 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.398 2015/10/25 21:58:04 deraadt Exp $ */ +/* $OpenBSD: if.c,v 1.399 2015/10/27 10:52:17 mpi Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -2341,6 +2341,7 @@ if_group_routechange(struct sockaddr *dst, struct sockaddr *mask) int if_group_egress_build(void) { + struct ifnet *ifp; struct ifg_group *ifg; struct ifg_member *ifgm, *next; struct sockaddr_in sa_in; @@ -2364,8 +2365,11 @@ if_group_egress_build(void) if (rt0 != NULL) { rt = rt0; do { - if (rt->rt_ifp) - if_addgroup(rt->rt_ifp, IFG_EGRESS); + ifp = if_get(rt->rt_ifidx); + if (ifp != NULL) { + if_addgroup(ifp, IFG_EGRESS); + if_put(ifp); + } #ifndef SMALL_KERNEL rt = rt_mpath_next(rt); #else @@ -2381,8 +2385,11 @@ if_group_egress_build(void) if (rt0 != NULL) { rt = rt0; do { - if (rt->rt_ifp) - if_addgroup(rt->rt_ifp, IFG_EGRESS); + ifp = if_get(rt->rt_ifidx); + if (ifp != NULL) { + if_addgroup(ifp, IFG_EGRESS); + if_put(ifp); + } #ifndef SMALL_KERNEL rt = rt_mpath_next(rt); #else -- cgit v1.2.3