]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r325008
authortruckman <truckman@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 12 Nov 2017 01:28:20 +0000 (01:28 +0000)
committertruckman <truckman@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 12 Nov 2017 01:28:20 +0000 (01:28 +0000)
commit2d890278b32a3e7f49ad52e02d5b688264a852a3
tree3ad259149cea5011016d035c3c21960231458dfe
parentb3d9cb64e7ce6fd5d0b1a415f4fe30f18322259a
MFC r325008

Fix Dummynet AQM packet marking function ecn_mark() and fq_codel /
fq_pie schedulers packet classification functions in layer2 (bridge mode).

Dummynet AQM packet marking function ecn_mark() and fq_codel/fq_pie
schedulers packet classification functions (fq_codel_classify_flow()
and fq_pie_classify_flow()) assume mbuf is pointing at L3 (IP)
packet. However, this assumption is incorrect if ipfw/dummynet is
used to manage layer2 traffic (bridge mode) since mbuf will point
at L2 frame.  This patch solves this problem by identifying the
source of the frame/packet (L2 or L3) and adding ETHER_HDR_LEN
offset when converting an mbuf pointer to ip pointer if the traffic
is from layer2.  More specifically, in dummynet packet tagging
function, tag_mbuf(), iphdr_off is set to ETHER_HDR_LEN if the
traffic is from layer2 and set to zero otherwise. Whenever an access
to IP header is required, mtodo(m, dn_tag_get(m)->iphdr_off) is
used instead of mtod(m, struct ip *) to correctly convert mbuf
pointer to ip pointer in both L2 and L3 traffic.

Submitted by: lstewart
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D12506

git-svn-id: svn://svn.freebsd.org/base/stable/10@325731 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/netpfil/ipfw/dn_sched_fifo.c
sys/netpfil/ipfw/dn_sched_fq_codel.c
sys/netpfil/ipfw/dn_sched_fq_pie.c
sys/netpfil/ipfw/dn_sched_prio.c
sys/netpfil/ipfw/dn_sched_qfq.c
sys/netpfil/ipfw/dn_sched_rr.c
sys/netpfil/ipfw/dn_sched_wf2q.c
sys/netpfil/ipfw/ip_dn_io.c
sys/netpfil/ipfw/ip_dn_private.h