MCPcopy Create free account
hub / github.com/F-Stack/f-stack / in6_update_ifa

Function in6_update_ifa

freebsd/netinet6/in6.c:868–896  ·  view source on GitHub ↗

* 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(). */

Source from the content-addressed store, hash-verified

866 * This function is separated from in6_control().
867 */
868int
869in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
870 struct in6_ifaddr *ia, int flags)
871{
872 int error, hostIsNew = 0;
873
874 if ((error = in6_validate_ifra(ifp, ifra, ia, flags)) != 0)
875 return (error);
876
877 if (ia == NULL) {
878 hostIsNew = 1;
879 if ((ia = in6_alloc_ifa(ifp, ifra, flags)) == NULL)
880 return (ENOBUFS);
881 }
882
883 error = in6_update_ifa_internal(ifp, ifra, ia, hostIsNew, flags);
884 if (error != 0) {
885 if (hostIsNew != 0) {
886 in6_unlink_ifa(ia, ifp);
887 ifa_free(&ia->ia_ifa);
888 }
889 return (error);
890 }
891
892 if (hostIsNew)
893 error = in6_broadcast_ifa(ifp, ifra, ia, flags);
894
895 return (error);
896}
897
898/*
899 * Fill in basic IPv6 address request info.

Callers 5

in6_controlFunction · 0.85
in6_ifattach_linklocalFunction · 0.85
in6_ifattach_loopbackFunction · 0.85
in6_ifaddFunction · 0.85
in6_tmpifaddFunction · 0.85

Calls 6

in6_validate_ifraFunction · 0.85
in6_alloc_ifaFunction · 0.85
in6_update_ifa_internalFunction · 0.85
in6_unlink_ifaFunction · 0.85
ifa_freeFunction · 0.85
in6_broadcast_ifaFunction · 0.85

Tested by

no test coverage detected