git: 050815ae7f9d - main - netlink: call IPv6 hook when adding IPv4 addresses.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 22 May 2023 13:45:19 UTC
The branch main has been updated by melifaro:
URL: https://cgit.FreeBSD.org/src/commit/?id=050815ae7f9dc2a93599b5321441698e331d0ba7
commit 050815ae7f9dc2a93599b5321441698e331d0ba7
Author: Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2023-05-22 13:41:34 +0000
Commit: Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2023-05-22 13:42:28 +0000
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].
---
sys/netlink/route/iface.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sys/netlink/route/iface.c b/sys/netlink/route/iface.c
index 84392aa5d7f7..920c473490ab 100644
--- a/sys/netlink/route/iface.c
+++ b/sys/netlink/route/iface.c
@@ -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