netlink: call IPv6 hook when adding IPv4 addresses.

This provides compatibility with ifioctl() version of SIOCAIFADDR.
This change is temporary until the IPv4/IPv6 address handling code
 is moved to netinet[6].
This commit is contained in:
Alexander V. Chernikov 2023-05-22 13:41:34 +00:00
parent e3f7081b1c
commit 050815ae7f

View file

@ -1155,7 +1155,12 @@ handle_newaddr_inet(struct nlmsghdr *hdr, struct nl_parsed_ifa *attrs,
if (attrs->ifa_dst != NULL)
req.ifra_dstaddr = *((struct sockaddr_in *)attrs->ifa_dst);
return (in_control(NULL, SIOCAIFADDR, &req, ifp, curthread));
int error = in_control(NULL, SIOCAIFADDR, &req, ifp, curthread);
#ifdef INET6
if (error == 0 && !(if_flags & IFF_UP) && (if_getflags(ifp) & IFF_UP))
in6_if_up(ifp);
#endif
return (error);
}
static int