Skip to content

Commit

Permalink
in in6_selectroute, check the address family of a cached destination,
Browse files Browse the repository at this point in the history
in case of sharing the cache with IPv4.
(in response to a bug report in kame-snap 5903 )
  • Loading branch information
jinmei committed Jan 20, 2002
1 parent 4b960fd commit 55cacbe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kame/sys/netinet6/in6_src.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $KAME: in6_src.c,v 1.101 2002/01/18 02:03:24 jinmei Exp $ */
/* $KAME: in6_src.c,v 1.102 2002/01/20 09:00:19 jinmei Exp $ */

/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Expand Down Expand Up @@ -758,11 +758,13 @@ in6_selectroute(dstsock, opts, mopts, ro, retifp, retrt, clone)

/*
* Use a cached route if it exists and is valid, else try to allocate
* a new one.
* a new one. Note that we should check the address family of the
* cached destination, in case of sharing the cache with IPv4.
*/
if (ro) {
if (ro->ro_rt &&
(!(ro->ro_rt->rt_flags & RTF_UP) ||
ro->ro_dst.sa_family != AF_INET6 ||
!IN6_ARE_ADDR_EQUAL(&satosin6(&ro->ro_dst)->sin6_addr,
dst))) {
RTFREE(ro->ro_rt);
Expand Down

0 comments on commit 55cacbe

Please sign in to comment.