summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/icmp6.c
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2014-01-13 23:03:52 +0000
committerbluhm <bluhm@openbsd.org>2014-01-13 23:03:52 +0000
commitb9e83c60a4e56c6dd88dea22c5646807d7f38c48 (patch)
tree68a479f327347b08799a42a0d4b0e44d2584a182 /sys/netinet6/icmp6.c
parentupdate for new options and clarify (diff)
downloadwireguard-openbsd-b9e83c60a4e56c6dd88dea22c5646807d7f38c48.tar.xz
wireguard-openbsd-b9e83c60a4e56c6dd88dea22c5646807d7f38c48.zip
Call all local valiables of type struct in6_ifaddr "ia6". This is
consistent with struct ifaddr "ifa" and struct in_ifaddr "ia". OK mpi@
Diffstat (limited to 'sys/netinet6/icmp6.c')
-rw-r--r--sys/netinet6/icmp6.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 0160e2ff484..325a211019a 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: icmp6.c,v 1.138 2014/01/07 17:07:46 mikeb Exp $ */
+/* $OpenBSD: icmp6.c,v 1.139 2014/01/13 23:03:52 bluhm Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
@@ -1629,7 +1629,7 @@ ni6_addrs(struct icmp6_nodeinfo *ni6, struct mbuf *m, struct ifnet **ifpp,
char *subj)
{
struct ifnet *ifp;
- struct in6_ifaddr *ifa6;
+ struct in6_ifaddr *ia6;
struct ifaddr *ifa;
struct sockaddr_in6 *subj_ip6 = NULL; /* XXX pedant */
int addrs = 0, addrsofif, iffound = 0;
@@ -1656,11 +1656,11 @@ ni6_addrs(struct icmp6_nodeinfo *ni6, struct mbuf *m, struct ifnet **ifpp,
TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
- ifa6 = ifatoia6(ifa);
+ ia6 = ifatoia6(ifa);
if ((niflags & NI_NODEADDR_FLAG_ALL) == 0 &&
IN6_ARE_ADDR_EQUAL(&subj_ip6->sin6_addr,
- &ifa6->ia_addr.sin6_addr))
+ &ia6->ia_addr.sin6_addr))
iffound = 1;
/*
@@ -1674,7 +1674,7 @@ ni6_addrs(struct icmp6_nodeinfo *ni6, struct mbuf *m, struct ifnet **ifpp,
*/
/* What do we have to do about ::1? */
- switch (in6_addrscope(&ifa6->ia_addr.sin6_addr)) {
+ switch (in6_addrscope(&ia6->ia_addr.sin6_addr)) {
case __IPV6_ADDR_SCOPE_LINKLOCAL:
if ((niflags & NI_NODEADDR_FLAG_LINKLOCAL) == 0)
continue;
@@ -1695,7 +1695,7 @@ ni6_addrs(struct icmp6_nodeinfo *ni6, struct mbuf *m, struct ifnet **ifpp,
* check if anycast is okay.
* XXX: just experimental. not in the spec.
*/
- if ((ifa6->ia6_flags & IN6_IFF_ANYCAST) != 0 &&
+ if ((ia6->ia6_flags & IN6_IFF_ANYCAST) != 0 &&
(niflags & NI_NODEADDR_FLAG_ANYCAST) == 0)
continue; /* we need only unicast addresses */
@@ -1717,7 +1717,7 @@ ni6_store_addrs(struct icmp6_nodeinfo *ni6, struct icmp6_nodeinfo *nni6,
struct ifnet *ifp0, int resid)
{
struct ifnet *ifp = ifp0 ? ifp0 : TAILQ_FIRST(&ifnet);
- struct in6_ifaddr *ifa6;
+ struct in6_ifaddr *ia6;
struct ifaddr *ifa;
struct ifnet *ifp_dep = NULL;
int copied = 0, allow_deprecated = 0;
@@ -1734,9 +1734,9 @@ ni6_store_addrs(struct icmp6_nodeinfo *ni6, struct icmp6_nodeinfo *nni6,
TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
- ifa6 = ifatoia6(ifa);
+ ia6 = ifatoia6(ifa);
- if ((ifa6->ia6_flags & IN6_IFF_DEPRECATED) != 0 &&
+ if ((ia6->ia6_flags & IN6_IFF_DEPRECATED) != 0 &&
allow_deprecated == 0) {
/*
* preferred address should be put before
@@ -1749,12 +1749,12 @@ ni6_store_addrs(struct icmp6_nodeinfo *ni6, struct icmp6_nodeinfo *nni6,
continue;
}
- else if ((ifa6->ia6_flags & IN6_IFF_DEPRECATED) == 0 &&
+ else if ((ia6->ia6_flags & IN6_IFF_DEPRECATED) == 0 &&
allow_deprecated != 0)
continue; /* we now collect deprecated addrs */
/* What do we have to do about ::1? */
- switch (in6_addrscope(&ifa6->ia_addr.sin6_addr)) {
+ switch (in6_addrscope(&ia6->ia_addr.sin6_addr)) {
case __IPV6_ADDR_SCOPE_LINKLOCAL:
if ((niflags & NI_NODEADDR_FLAG_LINKLOCAL) == 0)
continue;
@@ -1775,7 +1775,7 @@ ni6_store_addrs(struct icmp6_nodeinfo *ni6, struct icmp6_nodeinfo *nni6,
* check if anycast is okay.
* XXX: just experimental. not in the spec.
*/
- if ((ifa6->ia6_flags & IN6_IFF_ANYCAST) != 0 &&
+ if ((ia6->ia6_flags & IN6_IFF_ANYCAST) != 0 &&
(niflags & NI_NODEADDR_FLAG_ANYCAST) == 0)
continue;
@@ -1808,10 +1808,10 @@ ni6_store_addrs(struct icmp6_nodeinfo *ni6, struct icmp6_nodeinfo *nni6,
*
* TTL must be 2^31 > TTL >= 0.
*/
- if (ifa6->ia6_lifetime.ia6t_expire == 0)
+ if (ia6->ia6_lifetime.ia6t_expire == 0)
ltime = ND6_INFINITE_LIFETIME;
else {
- time_t diff = ifa6->ia6_lifetime.ia6t_expire -
+ time_t diff = ia6->ia6_lifetime.ia6t_expire -
time_second;
if (diff <= 0)
@@ -1826,10 +1826,10 @@ ni6_store_addrs(struct icmp6_nodeinfo *ni6, struct icmp6_nodeinfo *nni6,
cp += sizeof(u_int32_t);
/* copy the address itself */
- bcopy(&ifa6->ia_addr.sin6_addr, cp,
+ bcopy(&ia6->ia_addr.sin6_addr, cp,
sizeof(struct in6_addr));
/* XXX: KAME link-local hack; remove ifindex */
- if (IN6_IS_ADDR_LINKLOCAL(&ifa6->ia_addr.sin6_addr))
+ if (IN6_IS_ADDR_LINKLOCAL(&ia6->ia_addr.sin6_addr))
((struct in6_addr *)cp)->s6_addr16[1] = 0;
cp += sizeof(struct in6_addr);
@@ -1961,7 +1961,7 @@ icmp6_reflect(struct mbuf *m, size_t off)
{
struct ip6_hdr *ip6;
struct icmp6_hdr *icmp6;
- struct in6_ifaddr *ia;
+ struct in6_ifaddr *ia6;
struct in6_addr t, *src = 0;
int plen;
int type, code;
@@ -2046,13 +2046,13 @@ icmp6_reflect(struct mbuf *m, size_t off)
* (for example) when we encounter an error while forwarding procedure
* destined to a duplicated address of ours.
*/
- TAILQ_FOREACH(ia, &in6_ifaddr, ia_list)
- if (IN6_ARE_ADDR_EQUAL(&t, &ia->ia_addr.sin6_addr) &&
- (ia->ia6_flags & (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY)) == 0) {
+ TAILQ_FOREACH(ia6, &in6_ifaddr, ia_list)
+ if (IN6_ARE_ADDR_EQUAL(&t, &ia6->ia_addr.sin6_addr) &&
+ (ia6->ia6_flags & (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY)) == 0) {
src = &t;
break;
}
- if (ia == NULL && IN6_IS_ADDR_LINKLOCAL(&t) && (m->m_flags & M_LOOP)) {
+ if (ia6 == NULL && IN6_IS_ADDR_LINKLOCAL(&t) && (m->m_flags & M_LOOP)) {
/*
* This is the case if the dst is our link-local address
* and the sender is also ourselves.
@@ -2438,12 +2438,12 @@ icmp6_redirect_output(struct mbuf *m0, struct rtentry *rt)
{
/* get ip6 linklocal address for ifp(my outgoing interface). */
- struct in6_ifaddr *ia;
- if ((ia = in6ifa_ifpforlinklocal(ifp,
+ struct in6_ifaddr *ia6;
+ if ((ia6 = in6ifa_ifpforlinklocal(ifp,
IN6_IFF_NOTREADY|
IN6_IFF_ANYCAST)) == NULL)
goto fail;
- ifp_ll6 = &ia->ia_addr.sin6_addr;
+ ifp_ll6 = &ia6->ia_addr.sin6_addr;
}
/* get ip6 linklocal address for the router. */