summaryrefslogtreecommitdiff
path: root/sys/netinet6/nd6_nbr.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2013-03-04 14:42:26 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2013-03-04 14:42:26 +0000
commit276ad209008bb044f71bd23372b571b28367273e (patch)
treed3668ce4cf2e74024b62d997682bad295f31b37b /sys/netinet6/nd6_nbr.c
parentead282c6b876a48dc12d77e3496fb775d84d225a (diff)
Replace the cast to struct in6_ifaddr pointer with the ifatoia6() macro.
No binary change. OK claudio@
Diffstat (limited to 'sys/netinet6/nd6_nbr.c')
-rw-r--r--sys/netinet6/nd6_nbr.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index 95b0e107d3d..d177cb0becc 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_nbr.c,v 1.64 2013/03/03 00:35:14 bluhm Exp $ */
+/* $OpenBSD: nd6_nbr.c,v 1.65 2013/03/04 14:42:25 bluhm Exp $ */
/* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */
/*
@@ -184,7 +184,7 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len)
*/
#if 0 /* too much! */
ifa = &in6ifa_ifpwithaddr(ifp, &daddr6)->ia_ifa;
- if (ifa && (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_ANYCAST))
+ if (ifa && (ifatoia6(ifa)->ia6_flags & IN6_IFF_ANYCAST))
tlladdr = 0;
else
#endif
@@ -244,9 +244,9 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len)
goto freeit;
}
myaddr6 = *IFA_IN6(ifa);
- anycast = ((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_ANYCAST;
- tentative = ((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_TENTATIVE;
- if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_DUPLICATED)
+ anycast = ifatoia6(ifa)->ia6_flags & IN6_IFF_ANYCAST;
+ tentative = ifatoia6(ifa)->ia6_flags & IN6_IFF_TENTATIVE;
+ if (ifatoia6(ifa)->ia6_flags & IN6_IFF_DUPLICATED)
goto freeit;
if (lladdr && ((ifp->if_addrlen + 2 + 7) & ~7) != lladdrlen) {
@@ -635,8 +635,7 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len)
*
* Otherwise, process as defined in RFC 2461.
*/
- if (ifa
- && (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_TENTATIVE)) {
+ if (ifa && (ifatoia6(ifa)->ia6_flags & IN6_IFF_TENTATIVE)) {
nd6_dad_na_input(ifa);
goto freeit;
}
@@ -1105,7 +1104,7 @@ nd6_dad_stoptimer(struct dadq *dp)
void
nd6_dad_start(struct ifaddr *ifa, int *tick)
{
- struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa;
+ struct in6_ifaddr *ia = ifatoia6(ifa);
struct dadq *dp;
if (!dad_init) {
@@ -1216,7 +1215,7 @@ void
nd6_dad_timer(struct ifaddr *ifa)
{
int s;
- struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa;
+ struct in6_ifaddr *ia = ifatoia6(ifa);
struct dadq *dp;
s = splsoftnet(); /* XXX */
@@ -1320,7 +1319,7 @@ done:
void
nd6_dad_duplicated(struct ifaddr *ifa)
{
- struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa;
+ struct in6_ifaddr *ia = ifatoia6(ifa);
struct dadq *dp;
dp = nd6_dad_find(ifa);
@@ -1355,7 +1354,7 @@ nd6_dad_duplicated(struct ifaddr *ifa)
void
nd6_dad_ns_output(struct dadq *dp, struct ifaddr *ifa)
{
- struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa;
+ struct in6_ifaddr *ia = ifatoia6(ifa);
struct ifnet *ifp = ifa->ifa_ifp;
dp->dad_ns_tcount++;
@@ -1387,7 +1386,7 @@ nd6_dad_ns_input(struct ifaddr *ifa)
if (!ifa)
panic("ifa == NULL in nd6_dad_ns_input");
- ia = (struct in6_ifaddr *)ifa;
+ ia = ifatoia6(ifa);
taddr6 = &ia->ia_addr.sin6_addr;
duplicate = 0;
dp = nd6_dad_find(ifa);