HomeFreeBSD

ipfw: fix matching and setting DSCP value for IPv6

Description

ipfw: fix matching and setting DSCP value for IPv6

Matching for DSCP codes has used incorrect bits. Use IPV6_DSCP()
macro for matching opcodes to fix this. Also this leads to always
use value from a mbuf instead of cached value.

Previously different opcodes have used both cached in f_id value
and stored in the mbuf, and it did not always work after setdscp
action, since cached value was not updated.

Update IPv6 flowid value cached in the f_id.flow_id6 when we do
modification of DSCP value in O_SETDSCP opcode, it may be used by
external modules.

Also added logging support for O_SETDSCP opcode.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D34807

(cherry picked from commit 4763c0aa68a7147258922a33a8401f1f2067ba49)

Details

Provenance
aeAuthored on Apr 6 2022, 6:43 PM
Reviewer
kp
Differential Revision
D34807: ipfw: fix matching and setting DSCP value for IPv6
Parents
rG17c9c2049004: Fix ipfw fwd that doesn't work in some cases
Branches
Unknown
Tags
Unknown