freebsd-skq/sys/netpfil/ipfw
truckman df064ee4ac 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
MFC after:	2 weeks
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D12506
2017-10-26 10:11:35 +00:00
..
nat64 Do not acquire IPFW_WLOCK when a named object is created and destroyed. 2017-09-20 22:00:06 +00:00
nptv6 Do not acquire IPFW_WLOCK when a named object is created and destroyed. 2017-09-20 22:00:06 +00:00
pmod Fix IPv6 extension header parsing. The length field doesn't include the 2017-06-29 19:06:43 +00:00
test cleanup and document in some detail the internals of the testing code 2016-01-27 02:22:31 +00:00
dn_aqm_codel.c dummynet: Use strlcpy to appease static checkers 2017-04-13 17:47:44 +00:00
dn_aqm_codel.h Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). 2016-05-26 21:40:13 +00:00
dn_aqm_pie.c Fix the queue delay estimation in PIE/FQ-PIE when the timestamp 2017-05-19 08:38:03 +00:00
dn_aqm_pie.h Change several constants used by the PIE algorithm from unsigned to signed. 2017-03-18 23:00:13 +00:00
dn_aqm.h Correct a typo in a comment. 2016-05-26 22:03:28 +00:00
dn_heap.c avoid warnings for signed/unsigned comparison and unused arguments 2016-01-26 22:45:05 +00:00
dn_heap.h Fix typos in comments (returing -> returning) 2017-02-07 00:09:48 +00:00
dn_sched_fifo.c Fix Dummynet AQM packet marking function ecn_mark() and fq_codel / 2017-10-26 10:11:35 +00:00
dn_sched_fq_codel_helper.h Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). 2016-05-26 21:40:13 +00:00
dn_sched_fq_codel.c Fix Dummynet AQM packet marking function ecn_mark() and fq_codel / 2017-10-26 10:11:35 +00:00
dn_sched_fq_codel.h Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). 2016-05-26 21:40:13 +00:00
dn_sched_fq_pie.c Fix Dummynet AQM packet marking function ecn_mark() and fq_codel / 2017-10-26 10:11:35 +00:00
dn_sched_prio.c Fix Dummynet AQM packet marking function ecn_mark() and fq_codel / 2017-10-26 10:11:35 +00:00
dn_sched_qfq.c Fix Dummynet AQM packet marking function ecn_mark() and fq_codel / 2017-10-26 10:11:35 +00:00
dn_sched_rr.c Fix Dummynet AQM packet marking function ecn_mark() and fq_codel / 2017-10-26 10:11:35 +00:00
dn_sched_wf2q.c Fix Dummynet AQM packet marking function ecn_mark() and fq_codel / 2017-10-26 10:11:35 +00:00
dn_sched.h Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
dummynet.txt sys/net*: minor spelling fixes. 2016-05-03 18:05:43 +00:00
ip_dn_glue.c Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). 2016-05-26 21:40:13 +00:00
ip_dn_io.c Fix Dummynet AQM packet marking function ecn_mark() and fq_codel / 2017-10-26 10:11:35 +00:00
ip_dn_private.h Fix Dummynet AQM packet marking function ecn_mark() and fq_codel / 2017-10-26 10:11:35 +00:00
ip_dummynet.c In dummynet(4), random chunks of memory are casted to struct dn_*, 2017-01-09 20:51:51 +00:00
ip_fw2.c Add IPv6 support for O_TCPDATALEN opcode. 2017-10-24 08:39:05 +00:00
ip_fw_bpf.c Move logging via BPF support into separate file. 2016-08-13 15:41:04 +00:00
ip_fw_dynamic.c Do not acquire IPFW_WLOCK when a named object is created and destroyed. 2017-09-20 22:00:06 +00:00
ip_fw_eaction.c Add O_EXTERNAL_DATA opcode support. 2017-04-03 02:44:40 +00:00
ip_fw_iface.c Remove "IPFW static rules" rmlock. 2017-04-03 13:35:04 +00:00
ip_fw_log.c Add the log formatting for an external action opcode. 2017-04-03 02:26:30 +00:00
ip_fw_nat.c Remove "IPFW static rules" rmlock. 2017-04-03 13:35:04 +00:00
ip_fw_pfil.c Remove the mbuf tag after use (for reinjected packets). 2016-11-03 00:26:58 +00:00
ip_fw_private.h Remove "IPFW static rules" rmlock. 2017-04-03 13:35:04 +00:00
ip_fw_sockopt.c Remove "IPFW static rules" rmlock. 2017-04-03 13:35:04 +00:00
ip_fw_table_algo.c Use address of specific union member instead of whole union address to 2017-04-14 11:41:09 +00:00
ip_fw_table_value.c Remove "IPFW static rules" rmlock. 2017-04-03 13:35:04 +00:00
ip_fw_table.c Do not acquire IPFW_WLOCK when a named object is created and destroyed. 2017-09-20 22:00:06 +00:00
ip_fw_table.h