diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if.c | 7 | ||||
-rw-r--r-- | sys/netinet/in.c | 15 | ||||
-rw-r--r-- | sys/netinet6/in6.c | 6 | ||||
-rw-r--r-- | sys/netinet6/in6_ifattach.c | 4 | ||||
-rw-r--r-- | sys/netinet6/nd6.c | 6 | ||||
-rw-r--r-- | sys/netinet6/nd6_nbr.c | 16 | ||||
-rw-r--r-- | sys/netinet6/nd6_rtr.c | 8 |
7 files changed, 30 insertions, 32 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index cbeb5ce5076..e20c7e28a85 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.240 2011/10/24 17:51:31 camield Exp $ */ +/* $OpenBSD: if.c,v 1.241 2012/01/03 23:41:51 bluhm Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -2319,13 +2319,12 @@ ifnewlladdr(struct ifnet *ifp) /* Update the link-local address. Don't do it if we're * a router to avoid confusing hosts on the network. */ if (!(ifp->if_xflags & IFXF_NOINET6) && !ip6_forwarding) { - ifa = (struct ifaddr *)in6ifa_ifpforlinklocal(ifp, 0); + ifa = &in6ifa_ifpforlinklocal(ifp, 0)->ia_ifa; if (ifa) { in6_purgeaddr(ifa); in6_ifattach_linklocal(ifp, NULL); if (in6if_do_dad(ifp)) { - ifa = (struct ifaddr *) - in6ifa_ifpforlinklocal(ifp, 0); + ifa = &in6ifa_ifpforlinklocal(ifp, 0)->ia_ifa; if (ifa) nd6_dad_start(ifa, NULL); } diff --git a/sys/netinet/in.c b/sys/netinet/in.c index a611aae8f0c..d894227e95d 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in.c,v 1.69 2011/10/13 18:23:40 claudio Exp $ */ +/* $OpenBSD: in.c,v 1.70 2012/01/03 23:41:51 bluhm Exp $ */ /* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */ /* @@ -337,8 +337,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) case SIOCSIFBRDADDR: if ((ifp->if_flags & IFF_BROADCAST) == 0) return (EINVAL); - ifa_update_broadaddr(ifp, (struct ifaddr *)ia, - &ifr->ifr_broadaddr); + ifa_update_broadaddr(ifp, &ia->ia_ifa, &ifr->ifr_broadaddr); break; case SIOCSIFADDR: @@ -389,7 +388,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) if (newifaddr) ia->ia_broadaddr = ifra->ifra_broadaddr; else - ifa_update_broadaddr(ifp, (struct ifaddr *)ia, + ifa_update_broadaddr(ifp, &ia->ia_ifa, sintosa(&ifra->ifra_broadaddr)); } if (ifra->ifra_addr.sin_family == AF_INET && @@ -419,7 +418,7 @@ cleanup: s = splsoftnet(); in_ifscrub(ifp, ia); if (!error) - ifa_del(ifp, (struct ifaddr *)ia); + ifa_del(ifp, &ia->ia_ifa); TAILQ_REMOVE(&in_ifaddr, ia, ia_list); if (ia->ia_allhosts != NULL) { in_delmulti(ia->ia_allhosts); @@ -651,7 +650,7 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin, int s = splnet(), flags = RTF_UP, error; if (!newaddr) - ifa_del(ifp, (struct ifaddr *)ia); + ifa_del(ifp, &ia->ia_ifa); oldaddr = ia->ia_addr; ia->ia_addr = *sin; @@ -710,7 +709,7 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin, flags |= RTF_HOST; } else if (ifp->if_flags & IFF_POINTOPOINT) { if (ia->ia_dstaddr.sin_family != AF_INET) { - ifa_add(ifp, (struct ifaddr *)ia); + ifa_add(ifp, &ia->ia_ifa); return (0); } flags |= RTF_HOST; @@ -729,7 +728,7 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin, } if (!error) - ifa_add(ifp, (struct ifaddr *)ia); + ifa_add(ifp, &ia->ia_ifa); return (error); } diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 99535f54698..cd66d7a54f9 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.94 2011/11/24 17:39:55 sperreault Exp $ */ +/* $OpenBSD: in6.c,v 1.95 2012/01/03 23:41:51 bluhm Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -1205,7 +1205,7 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra, if (hostIsNew && in6if_do_dad(ifp) && (ifra->ifra_flags & IN6_IFF_NODAD) == 0) { - nd6_dad_start((struct ifaddr *)ia, NULL); + nd6_dad_start(&ia->ia_ifa, NULL); } return (error); @@ -1406,7 +1406,7 @@ in6_lifaddr_ioctl(struct socket *so, u_long cmd, caddr_t data, * address. hostid points to the first link-local * address attached to the interface. */ - ifa = (struct ifaddr *)in6ifa_ifpforlinklocal(ifp, 0); + ifa = &in6ifa_ifpforlinklocal(ifp, 0)->ia_ifa; if (!ifa) return EADDRNOTAVAIL; hostid = IFA_IN6(ifa); diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index 1a7d1b4c28e..96918584081 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_ifattach.c,v 1.52 2011/11/24 17:39:55 sperreault Exp $ */ +/* $OpenBSD: in6_ifattach.c,v 1.53 2012/01/03 23:41:51 bluhm Exp $ */ /* $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $ */ /* @@ -719,7 +719,7 @@ in6_ifdetach(struct ifnet *ifp) } /* remove from the linked list */ - ifa_del(ifp, (struct ifaddr *)ia); + ifa_del(ifp, &ia->ia_ifa); IFAFREE(&ia->ia_ifa); /* also remove from the IPv6 address chain(itojun&jinmei) */ diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 28cf0fa6f92..f995e27c38f 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.90 2011/12/27 17:20:04 bluhm Exp $ */ +/* $OpenBSD: nd6.c,v 1.91 2012/01/03 23:41:51 bluhm Exp $ */ /* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */ /* @@ -1175,8 +1175,8 @@ nd6_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info) * check if rt_key(rt) is one of my address assigned * to the interface. */ - ifa = (struct ifaddr *)in6ifa_ifpwithaddr(rt->rt_ifp, - &SIN6(rt_key(rt))->sin6_addr); + ifa = &in6ifa_ifpwithaddr(rt->rt_ifp, + &SIN6(rt_key(rt))->sin6_addr)->ia_ifa; if (ifa) { caddr_t macp = nd6_ifptomac(ifp); nd6_llinfo_settimer(ln, -1); diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index e1a497c4c5a..530e239f590 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_nbr.c,v 1.60 2011/11/24 17:39:55 sperreault Exp $ */ +/* $OpenBSD: nd6_nbr.c,v 1.61 2012/01/03 23:41:51 bluhm Exp $ */ /* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */ /* @@ -183,7 +183,7 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len) * We do not add one in MUST NOT cases. */ #if 0 /* too much! */ - ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, &daddr6); + ifa = &in6ifa_ifpwithaddr(ifp, &daddr6)->ia_ifa; if (ifa && (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_ANYCAST)) tlladdr = 0; else @@ -202,14 +202,14 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len) /* (1) and (3) check. */ #if NCARP > 0 if (ifp->if_type == IFT_CARP) { - ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, &taddr6); + ifa = &in6ifa_ifpwithaddr(ifp, &taddr6)->ia_ifa; if (ifa && !carp_iamatch6(ifp, lladdr, &proxydl)) ifa = NULL; } else { - ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, &taddr6); + ifa = &in6ifa_ifpwithaddr(ifp, &taddr6)->ia_ifa; } #else - ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, &taddr6); + ifa = &in6ifa_ifpwithaddr(ifp, &taddr6)->ia_ifa; #endif /* (2) check. */ @@ -229,8 +229,8 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len) /* * proxy NDP for single entry */ - ifa = (struct ifaddr *)in6ifa_ifpforlinklocal(ifp, - IN6_IFF_NOTREADY|IN6_IFF_ANYCAST); + ifa = &in6ifa_ifpforlinklocal(ifp, + IN6_IFF_NOTREADY | IN6_IFF_ANYCAST)->ia_ifa; if (ifa) { proxy = 1; proxydl = SDL(rt->rt_gateway); @@ -615,7 +615,7 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len) lladdrlen = ndopts.nd_opts_tgt_lladdr->nd_opt_len << 3; } - ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, &taddr6); + ifa = &in6ifa_ifpwithaddr(ifp, &taddr6)->ia_ifa; /* * Target address matches one of my interface address. diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 16591e8be83..5de5cf77fca 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_rtr.c,v 1.57 2011/12/27 17:20:04 bluhm Exp $ */ +/* $OpenBSD: nd6_rtr.c,v 1.58 2012/01/03 23:41:51 bluhm Exp $ */ /* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */ /* @@ -1568,8 +1568,8 @@ nd6_prefix_onlink(struct nd_prefix *pr) * We prefer link-local addresses as the associated interface address. */ /* search for a link-local addr */ - ifa = (struct ifaddr *)in6ifa_ifpforlinklocal(ifp, - IN6_IFF_NOTREADY | IN6_IFF_ANYCAST); + ifa = &in6ifa_ifpforlinklocal(ifp, + IN6_IFF_NOTREADY | IN6_IFF_ANYCAST)->ia_ifa; if (ifa == NULL) { /* XXX: freebsd does not have ifa_ifwithaf */ TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { @@ -1768,7 +1768,7 @@ in6_ifadd(struct nd_prefix *pr) * with the same interface identifier, than to have multiple addresses * with different interface identifiers. */ - ifa = (struct ifaddr *)in6ifa_ifpforlinklocal(ifp, 0); /* 0 is OK? */ + ifa = &in6ifa_ifpforlinklocal(ifp, 0)->ia_ifa; /* 0 is OK? */ if (ifa) ib = (struct in6_ifaddr *)ifa; else |