summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorqingli <qingli@FreeBSD.org>2009-08-14 23:44:59 +0000
committerqingli <qingli@FreeBSD.org>2009-08-14 23:44:59 +0000
commit5d81358a8ddc86a4956b176b693465e4502603f5 (patch)
treef7f3868ca6de4e103e090e672e61975f0c287655 /sys/netinet
parent51ca260850b223c3af3ad2e408661f29d2d54044 (diff)
downloadFreeBSD-src-5d81358a8ddc86a4956b176b693465e4502603f5.zip
FreeBSD-src-5d81358a8ddc86a4956b176b693465e4502603f5.tar.gz
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
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_output.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index bf2a5f8..33ba838 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -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) {
OpenPOWER on IntegriCloud