FreeBSD/sys/netinet6/in6.c
/*
 * Update/configure interface address parameters:
 *
 * 1) Update lifetime
 * 2) Update interface metric ad flags
 * 3) Notify other subsystems
 */
Update/configure interface address parameters:
1) Update lifetime
2) Update interface metric ad flags
3) Notify other subsystems
Update / configure interface address parameters : 1 ) Update lifetime 2 ) Update interface metric ad flags 3 ) Notify other subsystems
static int
in6_update_ifa_internal(struct ifnet *ifp, struct in6_aliasreq *ifra,
    struct in6_ifaddr *ia, int hostIsNew, int flags)
{
	int error;
	ia->ia6_updatetime = time_uptime;
	ia->ia6_lifetime = ifra->ifra_lifetime;
	if (ia->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME) {
		ia->ia6_lifetime.ia6t_expire =
		    time_uptime + ia->ia6_lifetime.ia6t_vltime;
	} else
		ia->ia6_lifetime.ia6t_expire = 0;
	if (ia->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME) {
		ia->ia6_lifetime.ia6t_preferred =
		    time_uptime + ia->ia6_lifetime.ia6t_pltime;
	} else
		ia->ia6_lifetime.ia6t_preferred = 0;
	if ((ifra->ifra_flags & IN6_IFF_DEPRECATED) != 0) {
		ia->ia6_lifetime.ia6t_pltime = 0;
		ia->ia6_lifetime.ia6t_preferred = time_uptime;
	}
	ia->ia6_flags = ifra->ifra_flags;
	ia->ia6_flags &= ~IN6_IFF_DUPLICATED;	
	if (in6if_do_dad(ifp) &&
	    (hostIsNew || (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED)))
		ia->ia6_flags |= IN6_IFF_TENTATIVE;
	error = in6_notify_ifa(ifp, ia, ifra, hostIsNew);
	return (error);
}
static int in6_update_ifa_internal ( struct ifnet * ifp , struct in6_aliasreq * ifra , struct in6_ifaddr * ia , int hostIsNew , int flags ) { int error ; ia -> ia6_updatetime = time_uptime ; ia -> ia6_lifetime = ifra -> ifra_lifetime ; if ( ia -> ia6_lifetime . ia6t_vltime != ND6_INFINITE_LIFETIME ) { ia -> ia6_lifetime . ia6t_expire = time_uptime + ia -> ia6_lifetime . ia6t_vltime ; } else ia -> ia6_lifetime . ia6t_expire = 0 ; if ( ia -> ia6_lifetime . ia6t_pltime != ND6_INFINITE_LIFETIME ) { ia -> ia6_lifetime . ia6t_preferred = time_uptime + ia -> ia6_lifetime . ia6t_pltime ; } else ia -> ia6_lifetime . ia6t_preferred = 0 ; if ( ( ifra -> ifra_flags & IN6_IFF_DEPRECATED ) != 0 ) { ia -> ia6_lifetime . ia6t_pltime = 0 ; ia -> ia6_lifetime . ia6t_preferred = time_uptime ; } ia -> ia6_flags = ifra -> ifra_flags ; ia -> ia6_flags &= ~ IN6_IFF_DUPLICATED ; if ( in6if_do_dad ( ifp ) && ( hostIsNew || ( ND_IFINFO ( ifp ) -> flags & ND6_IFF_IFDISABLED ) ) ) ia -> ia6_flags |= IN6_IFF_TENTATIVE ; error = in6_notify_ifa ( ifp , ia , ifra , hostIsNew ) ; return ( error ) ; }
Update/configure interface address parameters:
 1) Update lifetime
 2) Update interface metric ad flags
 3) Notify other subsystems
Update / configure interface address parameters : 1 ) Update lifetime 2 ) Update interface metric ad flags 3 ) Notify other subsystems
/* update timestamp */ /*
	 * Set lifetimes.  We do not refer to ia6t_expire and ia6t_preferred
	 * to see if the address is deprecated or invalidated, but initialize
	 * these members for applications.
	 */ /*
	 * backward compatibility - if IN6_IFF_DEPRECATED is set from the
	 * userland, make it deprecated.
	 */ /*
	 * configure address flags.
	 */ /*
	 * Make the address tentative before joining multicast addresses,
	 * so that corresponding MLD responses would not have a tentative
	 * source address.
	 */ /* safety */ /*
	 * DAD should be performed for an new address or addresses on
	 * an interface with ND6_IFF_IFDISABLED.
	 */ /* notify other subsystems */