Skip to content

Commit 6028da3

Browse files
choppsv1klassert
authored andcommitted
xfrm: fix bug with DSCP copy to v6 from v4 tunnel
When copying the DSCP bits for decap-dscp into IPv6 don't assume the outer encap is always IPv6. Instead, as with the inner IPv4 case, copy the DSCP bits from the correctly saved "tos" value in the control block. Fixes: 227620e ("[IPSEC]: Separate inner/outer mode processing on input") Signed-off-by: Christian Hopps <[email protected]> Acked-by: Herbert Xu <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent 0a9e579 commit 6028da3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

net/xfrm/xfrm_input.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,7 @@ static int xfrm6_remove_tunnel_encap(struct xfrm_state *x, struct sk_buff *skb)
279279
goto out;
280280

281281
if (x->props.flags & XFRM_STATE_DECAP_DSCP)
282-
ipv6_copy_dscp(ipv6_get_dsfield(ipv6_hdr(skb)),
283-
ipipv6_hdr(skb));
282+
ipv6_copy_dscp(XFRM_MODE_SKB_CB(skb)->tos, ipipv6_hdr(skb));
284283
if (!(x->props.flags & XFRM_STATE_NOECN))
285284
ipip6_ecn_decapsulate(skb);
286285

0 commit comments

Comments
 (0)