diff options
author | qingli <qingli@FreeBSD.org> | 2009-07-28 17:16:54 +0000 |
---|---|---|
committer | qingli <qingli@FreeBSD.org> | 2009-07-28 17:16:54 +0000 |
commit | 4092d532fe6dc0bf94bf61afe6e251b06754f6d0 (patch) | |
tree | 1fd6a31a9895e0706e93e88497e9d37df896f270 /sys/net/if_ethersubr.c | |
parent | 9fe0f9467b4922ce30ab16498b0a08678e759222 (diff) | |
download | FreeBSD-src-4092d532fe6dc0bf94bf61afe6e251b06754f6d0.zip FreeBSD-src-4092d532fe6dc0bf94bf61afe6e251b06754f6d0.tar.gz |
The new flow table caches both the routing table entry as well as the
L2 information. For an indirect route the cached L2 entry contains the
MAC address of the gateway. Typically the default route is used to
transmit multicast packets when explicit multicast routes are not
available. The ether_output() function bypasses L2 resolution function
if it verifies the L2 cache is valid, because the cached L2 address
(a unicast MAC address) is copied into the packets as the destination
MAC address. This validation, however, does not apply to broadcast and
multicast packets because the destination MAC address is mapped
according to a standard method instead.
Submitted by: Xin Li
Reviewed by: bz
Approved by: re
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r-- | sys/net/if_ethersubr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 6278db4..545d9ee 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -174,7 +174,8 @@ ether_output(struct ifnet *ifp, struct mbuf *m, int hlen; /* link layer header length */ if (ro != NULL) { - lle = ro->ro_lle; + if (!(m->m_flags & (M_BCAST | M_MCAST))) + lle = ro->ro_lle; rt0 = ro->ro_rt; } #ifdef MAC |