svn commit: r196234 - head/sys/netinet
Qing Li
qingli at FreeBSD.org
Fri Aug 14 23:44:59 UTC 2009
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) {
More information about the svn-src-head
mailing list