Lines Matching refs:ia
267 struct in6_ifaddr *ia;
289 for (ia = in6_ifaddrs; ia; ia = ia->ia_next) {
290 if (IN6_ARE_ADDR_EQUAL(IFA_IN6(ifa), &ia->ia_addr.sin6_addr)) {
414 struct in6_ifaddr *ia = NULL;
526 for (ia = in6_ifaddrs; ia != NULL; ia = nia) {
527 nia = ia->ia_next;
528 if (ia->ia_ifa.ifa_ifp != ifp)
530 if (ia->ia6_flags & IN6_IFF_AUTOCONF)
531 in6_purgeaddr(&ia->ia_ifa, 1);
559 for (ia = in6_ifaddrs; ia != NULL; ia = nia) {
560 nia = ia->ia_next;
561 if (ia->ia_ifa.ifa_ifp != ifp)
563 if (IN6_IS_ADDR_LINKLOCAL(&ia->ia_addr.sin6_addr))
564 in6_purgeaddr(&ia->ia_ifa, 1);
624 ia = in6ifa_ifpwithaddr(ifp, &ifra->ifra_addr.sin6_addr);
648 if (ia == NULL) {
679 if (ia == NULL) {
692 if (ia == NULL) {
715 ifr->ifr_addr = ia->ia_addr;
727 ifr->ifr_dstaddr = ia->ia_dstaddr;
731 ifr->ifr_addr = ia->ia_prefixmask;
735 ifr->ifr_ifru.ifru_flags6 = ia->ia6_flags;
770 ifr->ifr_ifru.ifru_lifetime = ia->ia6_lifetime;
774 ia->ia6_lifetime = ifr->ifr_ifru.ifru_lifetime;
776 if (ia->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME) {
777 ia->ia6_lifetime.ia6t_expire =
778 timenow.tv_sec + ia->ia6_lifetime.ia6t_vltime;
780 ia->ia6_lifetime.ia6t_expire = 0;
781 if (ia->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME) {
782 ia->ia6_lifetime.ia6t_preferred =
783 timenow.tv_sec + ia->ia6_lifetime.ia6t_pltime;
785 ia->ia6_lifetime.ia6t_preferred = 0;
814 if ((error = in6_update_ifa(ifp, ifra, ia)) != 0)
869 if ((ia = in6ifa_ifpwithaddr(ifp, &ifra->ifra_addr.sin6_addr))
875 if ((ia->ia6_flags & IN6_IFF_AUTOCONF) != 0 &&
876 ia->ia6_ndpr == NULL) { /* new autoconfed addr */
880 ia->ia6_ndpr = pr;
890 if ((e = in6_tmpifadd(ia, 1)) != 0) {
930 pr0.ndpr_plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr,
934 pr0.ndpr_prefix = ia->ia_addr;
935 pr0.ndpr_mask = ia->ia_prefixmask.sin6_addr;
938 ia->ia_prefixmask.sin6_addr.s6_addr32[i];
949 (((ia->ia6_flags & IN6_IFF_AUTOCONF) != 0 &&
951 ((ia->ia6_flags & IN6_IFF_AUTOCONF) == 0 &&
961 in6_purgeaddr(&ia->ia_ifa, 0);
980 in6_update_ifa(ifp, ifra, ia)
983 struct in6_ifaddr *ia;
1025 if (ia == NULL && ifra->ifra_prefixmask.sin6_len == 0)
1036 * In this case, ia must not be NULL. We just use its prefix
1039 plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL);
1117 if (ia == NULL) {
1126 ia = (struct in6_ifaddr *) _MALLOC(sizeof(*ia), M_IFADDR,
1128 if (ia == NULL)
1130 bzero((caddr_t)ia, sizeof(*ia));
1132 ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr;
1133 ia->ia_addr.sin6_family = AF_INET6;
1134 ia->ia_addr.sin6_len = sizeof(ia->ia_addr);
1140 ia->ia_ifa.ifa_dstaddr
1141 = (struct sockaddr *)&ia->ia_dstaddr;
1143 ia->ia_ifa.ifa_dstaddr = NULL;
1145 ia->ia_ifa.ifa_netmask
1146 = (struct sockaddr *)&ia->ia_prefixmask;
1148 ia->ia_ifp = ifp;
1153 oia->ia_next = ia;
1155 in6_ifaddrs = ia;
1159 if_attach_ifa(ifp, &ia->ia_ifa);
1171 if (ia->ia_prefixmask.sin6_len &&
1172 in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL) != plen) {
1175 ip6_sprintf(&ia->ia_addr.sin6_addr));
1179 ia->ia_prefixmask = ifra->ifra_prefixmask;
1189 &ia->ia_dstaddr.sin6_addr)) {
1192 if ((ia->ia_flags & IFA_ROUTE) != 0 &&
1193 (e = rtinit(&(ia->ia_ifa), (int)RTM_DELETE, RTF_HOST))
1197 ip6_sprintf(&ia->ia_addr.sin6_addr));
1201 ia->ia_flags &= ~IFA_ROUTE;
1202 ia->ia_dstaddr = dst6;
1206 if ((error = in6_ifinit(ifp, ia, &ifra->ifra_addr, hostIsNew)) != 0)
1220 iilen = (sizeof(ia->ia_prefixmask.sin6_addr) << 3) - plen;
1221 if ((error = in6_prefix_add_ifid(iilen, ia)) != 0) {
1222 in6_purgeaddr((struct ifaddr *)ia, 0);
1252 in6_purgeaddr((struct ifaddr *)ia, 0);
1277 (struct sockaddr *)&ia->ia_addr,
1300 if (in6m == NULL && ia != NULL) {
1351 ia->ia6_flags = ifra->ifra_flags;
1352 ia->ia6_flags &= ~IN6_IFF_DUPLICATED; /*safety*/
1353 ia->ia6_flags &= ~IN6_IFF_NODAD; /* Mobile IPv6 */
1355 ia->ia6_lifetime = ifra->ifra_lifetime;
1357 if (ia->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME) {
1358 ia->ia6_lifetime.ia6t_expire =
1359 timenow.tv_sec + ia->ia6_lifetime.ia6t_vltime;
1361 ia->ia6_lifetime.ia6t_expire = 0;
1362 if (ia->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME) {
1363 ia->ia6_lifetime.ia6t_preferred =
1364 timenow.tv_sec + ia->ia6_lifetime.ia6t_pltime;
1366 ia->ia6_lifetime.ia6t_preferred = 0;
1381 ia->ia6_flags |= IN6_IFF_TENTATIVE;
1382 nd6_dad_start((struct ifaddr *)ia, NULL);
1393 in6_unlink_ifa(ia, ifp, 0);
1402 struct in6_ifaddr *ia = (struct in6_ifaddr *) ifa;
1411 if ((ia->ia_flags & IFA_ROUTE) != 0 && ia->ia_dstaddr.sin6_len != 0) {
1414 if ((e = rtinit(&(ia->ia_ifa), (int)RTM_DELETE, RTF_HOST))
1419 ip6_sprintf(&ia->ia_addr.sin6_addr), if_name(ifp),
1424 ia->ia_flags &= ~IFA_ROUTE;
1428 in6_ifremloop(&(ia->ia_ifa), nd6_locked);
1442 ia->ia_addr.sin6_addr.s6_addr32[3];
1452 in6_unlink_ifa(ia, ifp, nd6_locked);
1453 in6_post_msg(ifp, KEV_INET6_ADDR_DELETED, ia);
1457 in6_unlink_ifa(ia, ifp, nd6_locked)
1458 struct in6_ifaddr *ia;
1466 if_detach_ifa(ifp, &ia->ia_ifa);
1471 oia = ia;
1472 if (oia == (ia = in6_ifaddrs))
1473 in6_ifaddrs = ia->ia_next;
1475 while (ia->ia_next && (ia->ia_next != oia))
1476 ia = ia->ia_next;
1477 if (ia->ia_next)
1478 ia->ia_next = oia->ia_next;
1524 struct in6_ifaddr *ia, *nia = NULL;
1530 for (ia = in6_ifaddrs; ia != NULL; ia = nia)
1532 nia = ia->ia_next;
1533 if (ia->ia_ifa.ifa_ifp != ifp)
1535 in6_purgeaddr(&ia->ia_ifa, 1);
1686 struct in6_ifaddr *ia;
1750 ia = ifa2ia6(ifa);
1758 bcopy(&ia->ia_addr, &iflr->addr, ia->ia_addr.sin6_len);
1768 bcopy(&ia->ia_dstaddr, &iflr->dstaddr,
1769 ia->ia_dstaddr.sin6_len);
1783 in6_mask2len(&ia->ia_prefixmask.sin6_addr,
1786 iflr->flags = ia->ia6_flags; /* XXX */
1797 bcopy(&ia->ia_addr, &ifra.ifra_addr,
1798 ia->ia_addr.sin6_len);
1800 bcopy(&ia->ia_dstaddr, &ifra.ifra_dstaddr,
1801 ia->ia_dstaddr.sin6_len);
1806 bcopy(&ia->ia_prefixmask, &ifra.ifra_dstaddr,
1807 ia->ia_prefixmask.sin6_len);
1809 ifra.ifra_flags = ia->ia6_flags;
1824 in6_ifinit(ifp, ia, sin6, newhost)
1826 struct in6_ifaddr *ia;
1849 ia->ia_addr = *sin6;
1853 (error = ifnet_ioctl(ifp, PF_INET6, SIOCSIFADDR, ia))) {
1859 ia->ia_ifa.ifa_metric = ifp->if_metric;
1869 plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */
1870 if (plen == 128 && ia->ia_dstaddr.sin6_family == AF_INET6) {
1871 if ((error = rtinit(&(ia->ia_ifa), (int)RTM_ADD,
1874 ia->ia_flags |= IFA_ROUTE;
1880 ia->ia_ifa.ifa_flags |= RTF_CLONING;
1886 ia->ia_ifa.ifa_rtrequest = nd6_rtrequest;
1887 in6_ifaddloop(&(ia->ia_ifa));
2124 struct in6_ifaddr *ia;
2130 for (ia = in6_ifaddrs; ia; ia = ia->ia_next)
2131 if (IN6_ARE_MASKED_ADDR_EQUAL(in6, &ia->ia_addr.sin6_addr,
2132 &ia->ia_prefixmask.sin6_addr)) {
2145 struct in6_ifaddr *ia;
2148 for (ia = in6_ifaddrs; ia; ia = ia->ia_next) {
2149 if (IN6_ARE_ADDR_EQUAL(&ia->ia_addr.sin6_addr,
2152 ia->ia_addr.sin6_scope_id == sa6->sin6_scope_id &&
2154 (ia->ia6_flags & IN6_IFF_DEPRECATED) != 0) {
2626 struct in6_ifaddr *ia;
2643 ia = (struct in6_ifaddr *)ifa;
2644 if (ia->ia6_flags & IN6_IFF_TENTATIVE)