summaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2015-10-27 10:52:19 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2015-10-27 10:52:19 +0000
commit3b627506255c1d92257a6c7e55e8adb4231a9992 (patch)
treedc8dc071c174613e80e0d5576166cf3d986cd88f /sys/net/if.c
parent969b07d812ebfc2e865ad4882496bacea22f7014 (diff)
Use rt_ifidx rather than rt_ifp.
ok bluhm@
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c17
1 files changed, 12 insertions, 5 deletions
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