rem: assert(pii->pii_flags & IFF_STANDBY); if (!pi->pi_empty) {
add: if (!pi->pi_empty && (pi->pi_flags & IFF_STANDBY))
context: process_rtm_ifinfo(if_msghdr_t *ifm, int type){	struct sockaddr_dl *sdl;	struct phyint *pi;	uint64_t old_flags;	struct phyint_instance *pii;	assert(ifm->ifm_type == RTM_IFINFO && ifm->ifm_addrs == RTA_IFP);	/*	 * Although the sockaddr_dl structure is directly after the	 * if_msghdr_t structure. At the time of writing, the size of the	 * if_msghdr_t structure is different on 32 and 64 bit kernels, due	 * to the presence of a timeval structure, which contains longs,	 * in the if_data structure.  Anyway, we know where the message ends,	 * so we work backwards to get the start of the sockaddr_dl structure.	 */	/*LINTED*/	sdl = (struct sockaddr_dl *)((char *)ifm + ifm->ifm_msglen -		sizeof (struct sockaddr_dl));	assert(sdl->sdl_family == AF_LINK);	/*	 * The interface name is in sdl_data.	 * RTM_IFINFO messages are only generated for logical interface	 * zero, so there is no colon and logical interface number to	 * strip from the name.	 The name is not null terminated, but	 * there should be enough space in sdl_data to add the null.	 */	if (sdl->sdl_nlen >= sizeof (sdl->sdl_data)) {		if (debug & D_LINKNOTE)			logdebug("process_rtm_ifinfo: "				"phyint name too long\n");		return (_B_TRUE);	}	sdl->sdl_data[sdl->sdl_nlen] = 0;	pi = phyint_lookup(sdl->sdl_data);	if (pi == NULL) {		if (debug & D_LINKNOTE)			logdebug("process_rtm_ifinfo: phyint lookup failed"				" for %s\n", sdl->sdl_data);		return (_B_TRUE);	}	/*	 * We want to try and avoid doing a full interface scan for	 * link state notifications from the NICs, as indicated	 * by the state of the IFF_RUNNING flag.  If just the	 * IFF_RUNNING flag has changed state, the link state changes	 * are processed without a full scan.	 * If there is both an IPv4 and IPv6 instance associated with	 * the physical interface, we will get an RTM_IFINFO message	 * for each instance.  If we just maintained a single copy of	 * the physical interface flags, it would appear that no flags	 * had changed when the second message is processed, leading us	 * to believe that the message wasn't generated by a flags change,	 * and that a full interface scan is required.	 * To get around this problem, two additional copies of the flags	 * are kept, one copy for each instance.  These are only used in	 * this routine.  At any one time, all three copies of the flags	 * should be identical except for the IFF_RUNNING flag.	 The	 * copy of the flags in the "phyint" structure is always up to	 * date.	 */	pii = (type == AF_INET) ? pi->pi_v4 : pi->pi_v6;	if (pii == NULL) {		if (debug & D_LINKNOTE)			logdebug("process_rtm_ifinfo: no instance of address "			    "family %s for %s\n", AF_STR(type), pi->pi_name);		return (_B_TRUE);	}	old_flags = pii->pii_flags;	pii->pii_flags = PHYINT_FLAGS(ifm->ifm_flags);	pi->pi_flags = pii->pii_flags;	if (debug & D_LINKNOTE) {		logdebug("process_rtm_ifinfo: %s address family: %s, "		    "old flags: %llx, new flags: %llx\n", pi->pi_name,		    AF_STR(type), old_flags, pi->pi_flags);	}	/*	 * If IFF_STANDBY has changed, indicate that the interface has changed	 * types.	 */	if ((old_flags ^ pii->pii_flags) & IFF_STANDBY)		phyint_newtype(pi);	/*	 * If IFF_INACTIVE has been set, then no data addresses should be	 * hosted on the interface.  If IFF_INACTIVE has been cleared, then	 * move previously failed-over addresses back to it, provided it is	 * not failed.	For details, see the state diagram in mpd_probe.c.	 */	if ((old_flags ^ pii->pii_flags) & IFF_INACTIVE) {		if (pii->pii_flags & IFF_INACTIVE) {			assert(pii->pii_flags & IFF_STANDBY);			if (!pi->pi_empty) {				(void) try_failover(pi, FAILOVER_TO_NONSTANDBY);			}		} else {			if (pi->pi_state == PI_RUNNING && !pi->pi_full) {				pi->pi_empty = 0;				(void) try_failback(pi, _B_FALSE);			}		}	}	/* Has just the IFF_RUNNING flag changed state ? */	if ((old_flags ^ pii->pii_flags) != IFF_RUNNING) {		struct phyint_instance *pii_other;		/*		 * It wasn't just a link state change.	Update		 * the other instance's copy of the flags.		 */		pii_other = phyint_inst_other(pii);		if (pii_other != NULL)			pii_other->pii_flags = pii->pii_flags;		return (_B_TRUE);	}	return (_B_FALSE);}