View | Details | Raw Unified | Return to bug 188032
Collapse All | Expand All

(-)sys/netinet6/in6.c (-25 / +23 lines)
Lines 638-644 in6_control(struct socket *so, u_long cmd, caddr_t Link Here
638
		pr0.ndpr_plen = in6_mask2len(&ifra->ifra_prefixmask.sin6_addr,
638
		pr0.ndpr_plen = in6_mask2len(&ifra->ifra_prefixmask.sin6_addr,
639
		    NULL);
639
		    NULL);
640
		if (pr0.ndpr_plen == 128) {
640
		if (pr0.ndpr_plen == 128) {
641
			break;	/* we don't need to install a host route. */
641
			/* we don't need to install a host route. */
642
			goto aifaddr_out;
642
		}
643
		}
643
		pr0.ndpr_prefix = ifra->ifra_addr;
644
		pr0.ndpr_prefix = ifra->ifra_addr;
644
		/* apply the mask for safety. */
645
		/* apply the mask for safety. */
Lines 705-736 in6_control(struct socket *so, u_long cmd, caddr_t Link Here
705
		 * that is, this address might make other addresses detached.
706
		 * that is, this address might make other addresses detached.
706
		 */
707
		 */
707
		pfxlist_onlink_check();
708
		pfxlist_onlink_check();
708
		if (error == 0 && ia) {
709
aifaddr_out:
709
			if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) {
710
		if (error != 0 || ia == NULL)
710
				/*
711
			break;
711
				 * Try to clear the flag when a new
712
		/*
712
				 * IPv6 address is added onto an
713
		 * Try to clear the flag when a new IPv6 address is added
713
				 * IFDISABLED interface and it
714
		 * onto an IFDISABLED interface and it succeeds.
714
				 * succeeds.
715
		 */
715
				 */
716
		if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) {
716
				struct in6_ndireq nd;
717
			struct in6_ndireq nd;
717
718
718
				memset(&nd, 0, sizeof(nd));
719
			memset(&nd, 0, sizeof(nd));
719
				nd.ndi.flags = ND_IFINFO(ifp)->flags;
720
			nd.ndi.flags = ND_IFINFO(ifp)->flags;
720
				nd.ndi.flags &= ~ND6_IFF_IFDISABLED;
721
			nd.ndi.flags &= ~ND6_IFF_IFDISABLED;
721
				if (nd6_ioctl(SIOCSIFINFO_FLAGS,
722
			if (nd6_ioctl(SIOCSIFINFO_FLAGS, (caddr_t)&nd, ifp) < 0)
722
				    (caddr_t)&nd, ifp) < 0)
723
				log(LOG_NOTICE, "SIOCAIFADDR_IN6: "
723
					log(LOG_NOTICE, "SIOCAIFADDR_IN6: "
724
				    "SIOCSIFINFO_FLAGS for -ifdisabled "
724
					    "SIOCSIFINFO_FLAGS for -ifdisabled "
725
				    "failed.");
725
					    "failed.");
726
			/*
726
				/*
727
			 * Ignore failure of clearing the flag intentionally.
727
				 * Ignore failure of clearing the flag
728
			 * The failure means address duplication was detected.
728
				 * intentionally.  The failure means
729
			 */
729
				 * address duplication was detected.
730
				 */
731
			}
732
			EVENTHANDLER_INVOKE(ifaddr_event, ifp);
733
		}
730
		}
731
		EVENTHANDLER_INVOKE(ifaddr_event, ifp);
734
		break;
732
		break;
735
	}
733
	}
736
734

Return to bug 188032