diff options
author | 2015-07-08 08:48:34 +0000 | |
---|---|---|
committer | 2015-07-08 08:48:34 +0000 | |
commit | 1a3ab866f3a65c9cf50f606115e5a2de596ba10e (patch) | |
tree | d5051785583bded90442ae5129b910f8de7f464b /sys/netinet6/icmp6.c | |
parent | Check for RTF_CONNECTED to track interface (connected) routes. (diff) | |
download | wireguard-openbsd-1a3ab866f3a65c9cf50f606115e5a2de596ba10e.tar.xz wireguard-openbsd-1a3ab866f3a65c9cf50f606115e5a2de596ba10e.zip |
Pass an interface index instead of a pointer to in6_addr2scopeid().
ok millert@
Diffstat (limited to 'sys/netinet6/icmp6.c')
-rw-r--r-- | sys/netinet6/icmp6.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 553e41055b7..b5477bf9f6f 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icmp6.c,v 1.160 2015/06/30 15:30:17 mpi Exp $ */ +/* $OpenBSD: icmp6.c,v 1.161 2015/07/08 08:48:34 mpi Exp $ */ /* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */ /* @@ -928,8 +928,8 @@ icmp6_notify_error(struct mbuf *m, int off, int icmp6len, int code) icmp6dst.sin6_addr = eip6->ip6_dst; else icmp6dst.sin6_addr = *finaldst; - icmp6dst.sin6_scope_id = in6_addr2scopeid( - if_get(m->m_pkthdr.ph_ifidx), &icmp6dst.sin6_addr); + icmp6dst.sin6_scope_id = in6_addr2scopeid(m->m_pkthdr.ph_ifidx, + &icmp6dst.sin6_addr); if (in6_embedscope(&icmp6dst.sin6_addr, &icmp6dst, NULL, NULL)) { /* should be impossbile */ @@ -946,8 +946,8 @@ icmp6_notify_error(struct mbuf *m, int off, int icmp6len, int code) icmp6src.sin6_len = sizeof(struct sockaddr_in6); icmp6src.sin6_family = AF_INET6; icmp6src.sin6_addr = eip6->ip6_src; - icmp6src.sin6_scope_id = in6_addr2scopeid( - if_get(m->m_pkthdr.ph_ifidx), &icmp6src.sin6_addr); + icmp6src.sin6_scope_id = in6_addr2scopeid(m->m_pkthdr.ph_ifidx, + &icmp6src.sin6_addr); if (in6_embedscope(&icmp6src.sin6_addr, &icmp6src, NULL, NULL)) { /* should be impossbile */ @@ -1034,7 +1034,7 @@ icmp6_mtudisc_update(struct ip6ctlparam *ip6cp, int validated) if (IN6_IS_ADDR_LINKLOCAL(dst)) { sin6.sin6_addr.s6_addr16[1] = htons(m->m_pkthdr.ph_ifidx); } - sin6.sin6_scope_id = in6_addr2scopeid(if_get(m->m_pkthdr.ph_ifidx), + sin6.sin6_scope_id = in6_addr2scopeid(m->m_pkthdr.ph_ifidx, &sin6.sin6_addr); rt = icmp6_mtudisc_clone(sin6tosa(&sin6), m->m_pkthdr.ph_rtableid); @@ -1610,7 +1610,7 @@ icmp6_redirect_output(struct mbuf *m0, struct rtentry *rt) src_sa.sin6_len = sizeof(src_sa); src_sa.sin6_addr = sip6->ip6_src; /* we don't currently use sin6_scope_id, but eventually use it */ - src_sa.sin6_scope_id = in6_addr2scopeid(ifp, &sip6->ip6_src); + src_sa.sin6_scope_id = in6_addr2scopeid(ifp->if_index, &sip6->ip6_src); if (nd6_is_addr_neighbor(&src_sa, ifp) == 0) goto fail; if (IN6_IS_ADDR_MULTICAST(&sip6->ip6_dst)) |