Date: Fri, 14 Aug 2009 23:44:59 +0000 (UTC) From: Qing Li <qingli@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r196234 - head/sys/netinet Message-ID: <200908142344.n7ENixMN051744@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: qingli Date: Fri Aug 14 23:44:59 2009 New Revision: 196234 URL: http://svn.freebsd.org/changeset/base/196234 Log: In function ip_output(), the cached route is flushed when there is a mismatch between the cached entry and the intended destination. The cached rtentry{} is flushed but the associated llentry{} is not. This causes the wrong destination MAC address being used in the output packets. The fix is to flush the llentry{} when rtentry{} is cleared. Reviewed by: kmacy, rwatson Approved by: re Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Aug 14 23:05:10 2009 (r196233) +++ head/sys/netinet/ip_output.c Fri Aug 14 23:44:59 2009 (r196234) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include <sys/ucred.h> #include <net/if.h> +#include <net/if_llatbl.h> #include <net/netisr.h> #include <net/pfil.h> #include <net/route.h> @@ -201,9 +202,12 @@ again: if (ro->ro_rt && ((ro->ro_rt->rt_flags & RTF_UP) == 0 || dst->sin_family != AF_INET || dst->sin_addr.s_addr != ip->ip_dst.s_addr)) { - if (!nortfree) + if (!nortfree) { RTFREE(ro->ro_rt); + LLE_FREE(ro->ro_lle); + } ro->ro_rt = (struct rtentry *)NULL; + ro->ro_lle = (struct llentry *)NULL; } #ifdef IPFIREWALL_FORWARD if (ro->ro_rt == NULL && fwd_tag == NULL) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908142344.n7ENixMN051744>