diff options
| author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2002-01-21 20:04:22 +0000 |
|---|---|---|
| committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2002-01-21 20:04:22 +0000 |
| commit | a4a6e77341f3e87d47c13677ceb5ebde87d45372 (patch) | |
| tree | f1d0e2bb684624d1cce9cf1ed2331e9cfff12de8 /sys/netinet/ip_output.c | |
| parent | 54c1b8821b309912ac37b47d64e6c59a8594af3b (diff) | |
Notes
Diffstat (limited to 'sys/netinet/ip_output.c')
| -rw-r--r-- | sys/netinet/ip_output.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index af06486163d6..1b9c28d6d60d 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -224,13 +224,17 @@ ip_output(m0, opt, ro, flags, imo) * If there is a cached route, * check that it is to the same destination * and is still up. If not, free it and try again. + * The address family should also be checked in case of sharing the + * cache with IPv6. */ if (ro->ro_rt && ((ro->ro_rt->rt_flags & RTF_UP) == 0 || - dst->sin_addr.s_addr != pkt_dst.s_addr)) { + dst->sin_family != AF_INET || + dst->sin_addr.s_addr != pkt_dst.s_addr)) { RTFREE(ro->ro_rt); ro->ro_rt = (struct rtentry *)0; } if (ro->ro_rt == 0) { + bzero(dst, sizeof(*dst)); dst->sin_family = AF_INET; dst->sin_len = sizeof(*dst); dst->sin_addr = pkt_dst; |
