]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Clean up the ether_input() path by using the M_PROMISC flag.
authorbms <bms@FreeBSD.org>
Mon, 19 Mar 2007 18:39:36 +0000 (18:39 +0000)
committerbms <bms@FreeBSD.org>
Mon, 19 Mar 2007 18:39:36 +0000 (18:39 +0000)
commit0ad9209c94ae47b69f7ebbfdc83630a1c787d396
treeeea68ab9d48e8b35b903dab128420d3d4b63092e
parent515a501549ecde68391cfcda8fa7589d3be40b09
Clean up the ether_input() path by using the M_PROMISC flag.

Main points of this change:
 * Drop frames immediately if the interface is not marked IFF_UP.
 * Always trim off the frame checksum if present.
 * Always use M_VLANTAG in preference to passing 802.1Q frames
   to consumers.
 * Use __func__ consistently for KASSERT().
 * Use the M_PROMISC flag to detect situations where ether_input()
   may reenter itself on the same call graph with the same mbuf which
   was promiscuously received on behalf of subsystems such as
   netgraph, carp, and vlan.
 * 802.1P frames (that is, VLAN frames with an ID of 0) will now be
   passed to layer 3 input paths.
 * Deal with the special case for CARP in a sane way.

This is a significant rewrite of code on the critical path. Please report
any issues to me if they arise. Frames will now only pass through dummynet
if M_PROMISC is cleared, to avoid problems with re-entry.

The handling of CARP needs to be revisited architecturally. The M_PROMISC
flag may potentially be demoted to a link-layer flag only as it is in
NetBSD, where the idea originated.

Discussed on: net
Idea from: NetBSD
Reviewed by: yar
MFC after: 1 month
sys/net/if_ethersubr.c