FreeBSD/sys/netinet6/in6.c
/*
 * Update parameters of an IPv6 interface address.
 * If necessary, a new entry is created and linked into address chains.
 * This function is separated from in6_control().
 */
Update parameters of an IPv6 interface address.
If necessary, a new entry is created and linked into address chains.
This function is separated from in6_control().
Update parameters of an IPv6 interface address . If necessary a new entry is created and linked into address chains . This function is separated from in6_control () .
int
in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
    struct in6_ifaddr *ia, int flags)
{
	int error, hostIsNew = 0;
	if ((error = in6_validate_ifra(ifp, ifra, ia, flags)) != 0)
		return (error);
	if (ia == NULL) {
		hostIsNew = 1;
		if ((ia = in6_alloc_ifa(ifp, ifra, flags)) == NULL)
			return (ENOBUFS);
	}
	error = in6_update_ifa_internal(ifp, ifra, ia, hostIsNew, flags);
	if (error != 0) {
		if (hostIsNew != 0) {
			in6_unlink_ifa(ia, ifp);
			ifa_free(&ia->ia_ifa);
		}
		return (error);
	}
	if (hostIsNew)
		error = in6_broadcast_ifa(ifp, ifra, ia, flags);
	return (error);
}
int in6_update_ifa ( struct ifnet * ifp , struct in6_aliasreq * ifra , struct in6_ifaddr * ia , int flags ) { int error , hostIsNew = 0 ; if ( ( error = in6_validate_ifra ( ifp , ifra , ia , flags ) ) != 0 ) return ( error ) ; if ( ia == NULL ) { hostIsNew = 1 ; if ( ( ia = in6_alloc_ifa ( ifp , ifra , flags ) ) == NULL ) return ( ENOBUFS ) ; } error = in6_update_ifa_internal ( ifp , ifra , ia , hostIsNew , flags ) ; if ( error != 0 ) { if ( hostIsNew != 0 ) { in6_unlink_ifa ( ia , ifp ) ; ifa_free ( & ia -> ia_ifa ) ; } return ( error ) ; } if ( hostIsNew ) error = in6_broadcast_ifa ( ifp , ifra , ia , flags ) ; return ( error ) ; }
Update parameters of an IPv6 interface address.
Update parameters of an IPv6 interface address .