Message ID | 20240306100438.3953516-6-steffen.klassert@secunet.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 8688ab2170a5be0bc922195f7091c38b506bab2e |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [1/5] xfrm: Clear low order bits of ->flowi4_tos in decode_session4(). | expand |
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c index 662c83beb345..e5722c95b8bb 100644 --- a/net/xfrm/xfrm_output.c +++ b/net/xfrm/xfrm_output.c @@ -704,9 +704,13 @@ int xfrm_output(struct sock *sk, struct sk_buff *skb) { struct net *net = dev_net(skb_dst(skb)->dev); struct xfrm_state *x = skb_dst(skb)->xfrm; + int family; int err; - switch (x->outer_mode.family) { + family = (x->xso.type != XFRM_DEV_OFFLOAD_PACKET) ? x->outer_mode.family + : skb_dst(skb)->ops->family; + + switch (family) { case AF_INET: memset(IPCB(skb), 0, sizeof(*IPCB(skb))); IPCB(skb)->flags |= IPSKB_XFRM_TRANSFORMED;