Skip to content

Commit d70b592

Browse files
blocktrronPaolo Abeni
authored andcommitted
l2tp: reset skb control buffer on xmit
The L2TP stack did not reset the skb control buffer before sending the encapsulated package. In a setup with an ath10k radio and batman-adv over an L2TP tunnel massive fragmentations happen sporadically if the L2TP tunnel is established over IPv4. L2TP might reset some of the fields in the IP control buffer, but L2TP assumes the type of the control buffer to be of an IPv4 packet. In case the L2TP interface is used as a batadv hardif or the packet is an IPv6 packet, this assumption breaks. Clear the entire control buffer to avoid such mishaps altogether. Fixes: f77ae93 ("[PPPOL2TP]: Reset meta-data in xmit function") Signed-off-by: David Bauer <mail@david-bauer.net> Link: https://patch.msgid.link/20251118001619.242107-1-mail@david-bauer.net Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 3ceb6ac commit d70b592

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

net/l2tp/l2tp_core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,9 +1246,9 @@ static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, uns
12461246
else
12471247
l2tp_build_l2tpv3_header(session, __skb_push(skb, session->hdr_len));
12481248

1249-
/* Reset skb netfilter state */
1250-
memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
1251-
IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED | IPSKB_REROUTED);
1249+
/* Reset control buffer */
1250+
memset(skb->cb, 0, sizeof(skb->cb));
1251+
12521252
nf_reset_ct(skb);
12531253

12541254
/* L2TP uses its own lockdep subclass to avoid lockdep splats caused by

0 commit comments

Comments
 (0)