Skip to content

Commit 71b1391

Browse files
Florian Westphaldavem330
Florian Westphal
authored andcommitted
l2tp: ensure sk->dst is still valid
When using l2tp over ipsec, the tunnel will hang when rekeying occurs. Reason is that the transformer bundle attached to the dst entry is now in STATE_DEAD and thus xfrm_output_one() drops all packets (XfrmOutStateExpired increases). Fix this by calling __sk_dst_check (which drops the stale dst if xfrm dst->check callback finds that the bundle is no longer valid). Cc: James Chapman <[email protected]> Signed-off-by: Florian Westphal <[email protected]> Acked-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8a6e77d commit 71b1391

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/l2tp/l2tp_core.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb, int hdr_len
10721072

10731073
/* Get routing info from the tunnel socket */
10741074
skb_dst_drop(skb);
1075-
skb_dst_set(skb, dst_clone(__sk_dst_get(sk)));
1075+
skb_dst_set(skb, dst_clone(__sk_dst_check(sk, 0)));
10761076

10771077
inet = inet_sk(sk);
10781078
fl = &inet->cork.fl;

0 commit comments

Comments
 (0)