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
This commit is contained in:
Qing Li 2009-08-14 23:44:59 +00:00
parent 9abb486279
commit 3ef5e21d01
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=196234

View File

@ -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 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags,
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) {