diff options
author | ume <ume@FreeBSD.org> | 2000-09-15 17:21:35 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2000-09-15 17:21:35 +0000 |
commit | d98e9631e37ec17749beb571397c592b3f413d4d (patch) | |
tree | 0dbe813fe7050357c63f0723149d5c55c49e5607 /sys/netinet6 | |
parent | 8f94bca53c13ca83d19d640dd99c3ef803615c2d (diff) | |
download | FreeBSD-src-d98e9631e37ec17749beb571397c592b3f413d4d.zip FreeBSD-src-d98e9631e37ec17749beb571397c592b3f413d4d.tar.gz |
examined the gateway (from the routing table) only when the address
family of the gateway is AF_INET6.
Submitted by: JINMEI Tatuya <jinmei@isl.rdc.toshiba.co.jp>
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/icmp6.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index b017bd8..a5f6326 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -2053,6 +2053,16 @@ icmp6_redirect_input(m, off) bcopy(&reddst6, &sin6.sin6_addr, sizeof(reddst6)); rt = rtalloc1((struct sockaddr *)&sin6, 0, 0UL); if (rt) { + if (rt->rt_gateway == NULL || + rt->rt_gateway->sa_family != AF_INET6) { + log(LOG_ERR, + "ICMP6 redirect rejected; no route " + "with inet6 gateway found for redirect dst: %s\n", + icmp6_redirect_diag(&src6, &reddst6, &redtgt6)); + RTFREE(rt); + goto freeit; + } + gw6 = &(((struct sockaddr_in6 *)rt->rt_gateway)->sin6_addr); if (bcmp(&src6, gw6, sizeof(struct in6_addr)) != 0) { log(LOG_ERR, |