-/* $OpenBSD: pf_if.c,v 1.69 2014/01/03 12:43:09 pelikan Exp $ */
+/* $OpenBSD: pf_if.c,v 1.70 2014/01/08 22:38:29 bluhm Exp $ */
/*
* Copyright 2005 Henning Brauer <henning@openbsd.org>
void
pfi_instance_add(struct ifnet *ifp, int net, int flags)
{
- struct ifaddr *ia;
+ struct ifaddr *ifa;
int got4 = 0, got6 = 0;
int net2, af;
if (ifp == NULL)
return;
- TAILQ_FOREACH(ia, &ifp->if_addrlist, ifa_list) {
- if (ia->ifa_addr == NULL)
+ TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
+ if (ifa->ifa_addr == NULL)
continue;
- af = ia->ifa_addr->sa_family;
+ af = ifa->ifa_addr->sa_family;
if (af != AF_INET && af != AF_INET6)
continue;
if ((flags & PFI_AFLAG_BROADCAST) && af == AF_INET6)
continue;
if ((flags & PFI_AFLAG_NETWORK) && af == AF_INET6 &&
IN6_IS_ADDR_LINKLOCAL(
- &((struct sockaddr_in6 *)ia->ifa_addr)->sin6_addr))
+ &((struct sockaddr_in6 *)ifa->ifa_addr)->sin6_addr))
continue;
if (flags & PFI_AFLAG_NOALIAS) {
if (af == AF_INET && got4)
if (net2 == 128 && (flags & PFI_AFLAG_NETWORK)) {
if (af == AF_INET)
net2 = pfi_unmask(&((struct sockaddr_in *)
- ia->ifa_netmask)->sin_addr);
+ ifa->ifa_netmask)->sin_addr);
else if (af == AF_INET6)
net2 = pfi_unmask(&((struct sockaddr_in6 *)
- ia->ifa_netmask)->sin6_addr);
+ ifa->ifa_netmask)->sin6_addr);
}
if (af == AF_INET && net2 > 32)
net2 = 32;
if (flags & PFI_AFLAG_BROADCAST)
- pfi_address_add(ia->ifa_broadaddr, af, net2);
+ pfi_address_add(ifa->ifa_broadaddr, af, net2);
else if (flags & PFI_AFLAG_PEER)
- pfi_address_add(ia->ifa_dstaddr, af, net2);
+ pfi_address_add(ifa->ifa_dstaddr, af, net2);
else
- pfi_address_add(ia->ifa_addr, af, net2);
+ pfi_address_add(ifa->ifa_addr, af, net2);
}
}
-/* $OpenBSD: in6_pcb.c,v 1.58 2013/12/20 02:04:09 krw Exp $ */
+/* $OpenBSD: in6_pcb.c,v 1.59 2014/01/08 22:38:29 bluhm Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
if (so->so_options & SO_REUSEADDR)
reuseport = SO_REUSEADDR | SO_REUSEPORT;
} else if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
- struct ifaddr *ia = NULL;
+ struct ifaddr *ifa = NULL;
sin6->sin6_port = 0; /*
* Yechhhh, because of upcoming
*/
sin6->sin6_flowinfo = 0;
if (!(so->so_options & SO_BINDANY) &&
- (ia = ifa_ifwithaddr(sin6tosa(sin6),
+ (ifa = ifa_ifwithaddr(sin6tosa(sin6),
inp->inp_rtableid)) == NULL)
return EADDRNOTAVAIL;
* flag to control the bind(2) behavior against
* deprecated addresses (default: forbid bind(2)).
*/
- if (ia &&
- ifatoia6(ia)->ia6_flags &
+ if (ifa &&
+ ifatoia6(ifa)->ia6_flags &
(IN6_IFF_ANYCAST|IN6_IFF_NOTREADY|IN6_IFF_DETACHED))
return (EADDRNOTAVAIL);
}
-/* $OpenBSD: raw_ip6.c,v 1.63 2013/12/20 02:04:09 krw Exp $ */
+/* $OpenBSD: raw_ip6.c,v 1.64 2014/01/08 22:38:29 bluhm Exp $ */
/* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */
/*
case PRU_BIND:
{
struct sockaddr_in6 *addr = mtod(nam, struct sockaddr_in6 *);
- struct ifaddr *ia = NULL;
+ struct ifaddr *ifa = NULL;
if (nam->m_len != sizeof(*addr)) {
error = EINVAL;
*/
if (!IN6_IS_ADDR_UNSPECIFIED(&addr->sin6_addr) &&
!(so->so_options & SO_BINDANY) &&
- (ia = ifa_ifwithaddr(sin6tosa(addr),
+ (ifa = ifa_ifwithaddr(sin6tosa(addr),
in6p->inp_rtableid)) == 0) {
error = EADDRNOTAVAIL;
break;
}
- if (ia && ifatoia6(ia)->ia6_flags &
+ if (ifa && ifatoia6(ifa)->ia6_flags &
(IN6_IFF_ANYCAST|IN6_IFF_NOTREADY|
IN6_IFF_DETACHED|IN6_IFF_DEPRECATED)) {
error = EADDRNOTAVAIL;