Convert some if_ref() to if_get().
authormpi <mpi@openbsd.org>
Sat, 24 Oct 2015 12:33:16 +0000 (12:33 +0000)
committermpi <mpi@openbsd.org>
Sat, 24 Oct 2015 12:33:16 +0000 (12:33 +0000)
ok claudio@

sys/netinet/ip_output.c
sys/netinet6/in6_src.c
sys/netinet6/ip6_output.c

index 5e9147a..3130e91 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ip_output.c,v 1.303 2015/10/20 20:22:42 benno Exp $   */
+/*     $OpenBSD: ip_output.c,v 1.304 2015/10/24 12:33:16 mpi Exp $     */
 /*     $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $  */
 
 /*
@@ -204,7 +204,7 @@ reroute:
                if (ISSET(ro->ro_rt->rt_flags, RTF_LOCAL))
                        ifp = if_ref(lo0ifp);
                else
-                       ifp = if_ref(ro->ro_rt->rt_ifp);
+                       ifp = if_get(ro->ro_rt->rt_ifidx);
                if ((mtu = ro->ro_rt->rt_rmx.rmx_mtu) == 0)
                        mtu = ifp->if_mtu;
 
index e4cb867..dfe5791 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: in6_src.c,v 1.65 2015/10/22 16:33:32 mpi Exp $        */
+/*     $OpenBSD: in6_src.c,v 1.66 2015/10/24 12:33:16 mpi Exp $        */
 /*     $KAME: in6_src.c,v 1.36 2001/02/06 04:08:17 itojun Exp $        */
 
 /*
@@ -457,7 +457,7 @@ in6_selectif(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
                return (rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
 
        if (rt != NULL)
-               *retifp = if_ref(rt->rt_ifp);
+               *retifp = if_get(rt->rt_ifidx);
 
        return (0);
 }
index a3cae03..e130d7f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ip6_output.c,v 1.190 2015/10/19 12:11:28 mpi Exp $    */
+/*     $OpenBSD: ip6_output.c,v 1.191 2015/10/24 12:33:16 mpi Exp $    */
 /*     $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $    */
 
 /*
@@ -553,7 +553,7 @@ reroute:
                if (ISSET(rt->rt_flags, RTF_LOCAL))
                        ifp = if_ref(lo0ifp);
                else
-                       ifp = if_ref(rt->rt_ifp);
+                       ifp = if_get(rt->rt_ifidx);
        } else {
                *dst = dstsock;
        }
@@ -2382,7 +2382,7 @@ ip6_setmoptions(int optname, struct ip6_moptions **im6op, struct mbuf *m)
                                error = EADDRNOTAVAIL;
                                break;
                        }
-                       ifp = if_ref(ro.ro_rt->rt_ifp);
+                       ifp = if_get(ro.ro_rt->rt_ifidx);
                        rtfree(ro.ro_rt);
                } else {
                        /*