Skip to content

Commit 8688ab2

Browse files
Mike Yuklassert
authored andcommitted
xfrm: set skb control buffer based on packet offload as well
In packet offload, packets are not encrypted in XFRM stack, so the next network layer which the packets will be forwarded to should depend on where the packet came from (either xfrm4_output or xfrm6_output) rather than the matched SA's family type. Test: verified IPv6-in-IPv4 packets on Android device with IPsec packet offload enabled Signed-off-by: Mike Yu <yumike@google.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
1 parent d4872d7 commit 8688ab2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

net/xfrm/xfrm_output.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,13 @@ int xfrm_output(struct sock *sk, struct sk_buff *skb)
704704
{
705705
struct net *net = dev_net(skb_dst(skb)->dev);
706706
struct xfrm_state *x = skb_dst(skb)->xfrm;
707+
int family;
707708
int err;
708709

709-
switch (x->outer_mode.family) {
710+
family = (x->xso.type != XFRM_DEV_OFFLOAD_PACKET) ? x->outer_mode.family
711+
: skb_dst(skb)->ops->family;
712+
713+
switch (family) {
710714
case AF_INET:
711715
memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
712716
IPCB(skb)->flags |= IPSKB_XFRM_TRANSFORMED;

0 commit comments

Comments
 (0)