summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Gross <vgross@cvs.openbsd.org>2016-09-02 13:53:45 +0000
committerVincent Gross <vgross@cvs.openbsd.org>2016-09-02 13:53:45 +0000
commit965d61fb0fd771bc6754e505675a41e2d0fcdbc6 (patch)
tree332bdb60a0384b8f3db1dbad04ae34c505fad0ec
parent8950a8e1ca1e58eda49307582f4f54e94781b4d9 (diff)
in6_selectroute should never get a valid struct route * filled with something
else than AF_INET6. Ok florian@
-rw-r--r--sys/netinet6/in6_src.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c
index 1e47e75f636..36fb922c638 100644
--- a/sys/netinet6/in6_src.c
+++ b/sys/netinet6/in6_src.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_src.c,v 1.79 2016/08/04 20:46:24 vgross Exp $ */
+/* $OpenBSD: in6_src.c,v 1.80 2016/09/02 13:53:44 vgross Exp $ */
/* $KAME: in6_src.c,v 1.36 2001/02/06 04:08:17 itojun Exp $ */
/*
@@ -302,13 +302,13 @@ in6_selectroute(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
/*
* Use a cached route if it exists and is valid, else try to allocate
- * a new one. Note that we should check the address family of the
- * cached destination, in case of sharing the cache with IPv4.
+ * a new one.
*/
if (ro) {
+ if (rtisvalid(ro->ro_rt))
+ KASSERT(sin6tosa(&ro->ro_dst)->sa_family == AF_INET6);
if (!rtisvalid(ro->ro_rt) ||
- sin6tosa(&ro->ro_dst)->sa_family != AF_INET6 ||
- !IN6_ARE_ADDR_EQUAL(&ro->ro_dst.sin6_addr, dst)) {
+ !IN6_ARE_ADDR_EQUAL(&ro->ro_dst.sin6_addr, dst)) {
rtfree(ro->ro_rt);
ro->ro_rt = NULL;
}