diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-09-27 12:26:17 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-09-27 12:26:17 +0000 |
commit | 2f6640143002b6320ac586e0c3018c39fc804901 (patch) | |
tree | 6733392d8818567dcf4cc1683f1b16a202bbfd58 /sys/netinet6 | |
parent | c43fd67b83d72fb5483ae3b81d1972645c2f7f2f (diff) |
Kill rtalloc() and update rtalloc1() and rtalloc_mpath() to no longer
rely on "struct route" that should die.
ok claudio@
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/frag6.c | 5 | ||||
-rw-r--r-- | sys/netinet6/in6_src.c | 14 | ||||
-rw-r--r-- | sys/netinet6/ip6_forward.c | 15 | ||||
-rw-r--r-- | sys/netinet6/ip6_input.c | 8 | ||||
-rw-r--r-- | sys/netinet6/ip6_output.c | 8 |
5 files changed, 31 insertions, 19 deletions
diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index dd8950aaa97..356b45ad66a 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frag6.c,v 1.54 2014/07/22 11:06:10 mpi Exp $ */ +/* $OpenBSD: frag6.c,v 1.55 2014/09/27 12:26:16 mpi Exp $ */ /* $KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $ */ /* @@ -194,7 +194,8 @@ frag6_input(struct mbuf **mp, int *offp, int proto) dst->sin6_len = sizeof(struct sockaddr_in6); dst->sin6_addr = ip6->ip6_dst; - rtalloc_mpath((struct route *)&ro, &ip6->ip6_src.s6_addr32[0]); + ro.ro_rt = rtalloc_mpath(sin6tosa(&ro.ro_dst), + &ip6->ip6_src.s6_addr32[0], ro.ro_tableid); if (ro.ro_rt != NULL && ro.ro_rt->rt_ifa != NULL) dstifp = ifatoia6(ro.ro_rt->rt_ifa)->ia_ifp; diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c index 6df0f49b5aa..85a1153d97a 100644 --- a/sys/netinet6/in6_src.c +++ b/sys/netinet6/in6_src.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_src.c,v 1.45 2014/07/22 11:06:10 mpi Exp $ */ +/* $OpenBSD: in6_src.c,v 1.46 2014/09/27 12:26:16 mpi Exp $ */ /* $KAME: in6_src.c,v 1.36 2001/02/06 04:08:17 itojun Exp $ */ /* @@ -264,9 +264,11 @@ in6_selectsrc(struct in6_addr **in6src, struct sockaddr_in6 *dstsock, sa6->sin6_addr = *dst; sa6->sin6_scope_id = dstsock->sin6_scope_id; if (IN6_IS_ADDR_MULTICAST(dst)) { - rtalloc((struct route *)ro); + ro->ro_rt = rtalloc1(sin6tosa(&ro->ro_dst), + RT_REPORT, ro->ro_tableid); } else { - rtalloc_mpath((struct route *)ro, NULL); + ro->ro_rt = rtalloc_mpath(sin6tosa(&ro->ro_dst), + NULL, ro->ro_tableid); } } @@ -380,7 +382,8 @@ selectroute(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, ron->ro_tableid = rtableid; } if (ron->ro_rt == NULL) { - rtalloc((struct route *)ron); /* multi path case? */ + ron->ro_rt = rtalloc1(sin6tosa(&ron->ro_dst), + RT_REPORT, ron->ro_tableid); /* multi path case? */ if (ron->ro_rt == NULL || (ron->ro_rt->rt_flags & RTF_GATEWAY)) { if (ron->ro_rt) { @@ -431,7 +434,8 @@ selectroute(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, *sa6 = *dstsock; sa6->sin6_scope_id = 0; ro->ro_tableid = rtableid; - rtalloc_mpath((struct route *)ro, NULL); + ro->ro_rt = rtalloc_mpath(sin6tosa(&ro->ro_dst), + NULL, ro->ro_tableid); } /* diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index cc66b458123..70513db5259 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_forward.c,v 1.67 2014/06/03 13:32:24 mpi Exp $ */ +/* $OpenBSD: ip6_forward.c,v 1.68 2014/09/27 12:26:16 mpi Exp $ */ /* $KAME: ip6_forward.c,v 1.75 2001/06/29 12:42:13 jinmei Exp $ */ /* @@ -250,8 +250,10 @@ reroute: } /* this probably fails but give it a try again */ ip6_forward_rt.ro_tableid = rtableid; - rtalloc_mpath((struct route *)&ip6_forward_rt, - &ip6->ip6_src.s6_addr32[0]); + ip6_forward_rt.ro_rt = rtalloc_mpath( + sin6tosa(&ip6_forward_rt.ro_dst), + &ip6->ip6_src.s6_addr32[0], + ip6_forward_rt.ro_tableid); } if (ip6_forward_rt.ro_rt == 0) { @@ -277,9 +279,10 @@ reroute: dst->sin6_family = AF_INET6; dst->sin6_addr = ip6->ip6_dst; ip6_forward_rt.ro_tableid = rtableid; - - rtalloc_mpath((struct route *)&ip6_forward_rt, - &ip6->ip6_src.s6_addr32[0]); + ip6_forward_rt.ro_rt = rtalloc_mpath( + sin6tosa(&ip6_forward_rt.ro_dst), + &ip6->ip6_src.s6_addr32[0], + ip6_forward_rt.ro_tableid); if (ip6_forward_rt.ro_rt == 0) { ip6stat.ip6s_noroute++; diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 60e67fccd28..14c681791b9 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_input.c,v 1.128 2014/07/22 11:06:10 mpi Exp $ */ +/* $OpenBSD: ip6_input.c,v 1.129 2014/09/27 12:26:16 mpi Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -449,8 +449,10 @@ ip6_input(struct mbuf *m) ip6_forward_rt.ro_dst.sin6_addr = ip6->ip6_dst; ip6_forward_rt.ro_tableid = rtableid; - rtalloc_mpath((struct route *)&ip6_forward_rt, - &ip6->ip6_src.s6_addr32[0]); + ip6_forward_rt.ro_rt = rtalloc_mpath( + sin6tosa(&ip6_forward_rt.ro_dst), + &ip6->ip6_src.s6_addr32[0], + ip6_forward_rt.ro_tableid); } /* diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index ffa8be1278a..5b1dce4e0a2 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_output.c,v 1.158 2014/07/22 11:06:10 mpi Exp $ */ +/* $OpenBSD: ip6_output.c,v 1.159 2014/09/27 12:26:16 mpi Exp $ */ /* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */ /* @@ -1229,7 +1229,8 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro, sa6_dst->sin6_len = sizeof(struct sockaddr_in6); sa6_dst->sin6_addr = *dst; - rtalloc((struct route *)ro_pmtu); + ro_pmtu->ro_rt = rtalloc1(sin6tosa(&ro_pmtu->ro_dst), + RT_REPORT, ro_pmtu->ro_tableid); } } if (ro_pmtu->ro_rt) { @@ -2482,7 +2483,8 @@ ip6_setmoptions(int optname, struct ip6_moptions **im6op, struct mbuf *m) dst->sin6_len = sizeof(struct sockaddr_in6); dst->sin6_family = AF_INET6; dst->sin6_addr = mreq->ipv6mr_multiaddr; - rtalloc((struct route *)&ro); + ro.ro_rt = rtalloc1(sin6tosa(&ro.ro_dst), + RT_REPORT, ro.ro_tableid); if (ro.ro_rt == NULL) { error = EADDRNOTAVAIL; break; |