Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/in.c
Show First 20 Lines • Show All 371 Lines • ▼ Show 20 Lines | in_aifaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct thread *td) | ||||
NET_EPOCH_ENTER(et); | NET_EPOCH_ENTER(et); | ||||
CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { | CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { | ||||
struct in_ifaddr *it; | struct in_ifaddr *it; | ||||
if (ifa->ifa_addr->sa_family != AF_INET) | if (ifa->ifa_addr->sa_family != AF_INET) | ||||
continue; | continue; | ||||
it = (struct in_ifaddr *)ifa; | it = (struct in_ifaddr *)ifa; | ||||
iaIsFirst = false; | |||||
if (it->ia_addr.sin_addr.s_addr == addr->sin_addr.s_addr && | if (it->ia_addr.sin_addr.s_addr == addr->sin_addr.s_addr && | ||||
prison_check_ip4(td->td_ucred, &addr->sin_addr) == 0) | prison_check_ip4(td->td_ucred, &addr->sin_addr) == 0) | ||||
ia = it; | ia = it; | ||||
else | |||||
iaIsFirst = false; | |||||
} | } | ||||
NET_EPOCH_EXIT(et); | NET_EPOCH_EXIT(et); | ||||
if (ia != NULL) | if (ia != NULL) | ||||
(void )in_difaddr_ioctl(cmd, data, ifp, td); | (void )in_difaddr_ioctl(cmd, data, ifp, td); | ||||
ifa = ifa_alloc(sizeof(struct in_ifaddr), M_WAITOK); | ifa = ifa_alloc(sizeof(struct in_ifaddr), M_WAITOK); | ||||
ia = (struct in_ifaddr *)ifa; | ia = (struct in_ifaddr *)ifa; | ||||
▲ Show 20 Lines • Show All 1,117 Lines • Show Last 20 Lines |