summaryrefslogtreecommitdiff
path: root/sys/netinet6/in6.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-11-28 14:14:40 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-11-28 14:14:40 +0000
commit13e8370e951b0f98f53aaec1eb7f2ca1ab17a106 (patch)
tree2bf98e129fc34bcb56290a8a9feb14d52e9d0919 /sys/netinet6/in6.c
parent1a439092a5c231540051a3ffb68dcf3fbceec96d (diff)
Explicitly initialize rti_ifa when automagically adding a route.
This will allow to strengthen checks when userland adds a route. ok phessler@, bluhm@
Diffstat (limited to 'sys/netinet6/in6.c')
-rw-r--r--sys/netinet6/in6.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 55d8d98f79d..8b9ff6da271 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.c,v 1.194 2016/10/04 14:04:19 mpi Exp $ */
+/* $OpenBSD: in6.c,v 1.195 2016/11/28 14:14:39 mpi Exp $ */
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
/*
@@ -746,9 +746,7 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
*/
rt = rtalloc(sin6tosa(&mltaddr), 0, ifp->if_rdomain);
if (rt) {
- /*
- * 32bit came from "mltmask"
- */
+ /* 32bit came from "mltmask" */
if (memcmp(&mltaddr.sin6_addr,
&satosin6(rt_key(rt))->sin6_addr,
32 / 8)) {
@@ -760,6 +758,7 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
struct rt_addrinfo info;
bzero(&info, sizeof(info));
+ info.rti_ifa = &ia6->ia_ifa;
info.rti_info[RTAX_DST] = sin6tosa(&mltaddr);
info.rti_info[RTAX_GATEWAY] = sin6tosa(&ia6->ia_addr);
info.rti_info[RTAX_NETMASK] = sin6tosa(&mltmask);
@@ -816,6 +815,7 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
struct rt_addrinfo info;
bzero(&info, sizeof(info));
+ info.rti_ifa = &ia6->ia_ifa;
info.rti_info[RTAX_DST] = sin6tosa(&mltaddr);
info.rti_info[RTAX_GATEWAY] = sin6tosa(&ia6->ia_addr);
info.rti_info[RTAX_NETMASK] = sin6tosa(&mltmask);