Skip to content

Commit 8929c30

Browse files
author
Guillaume Nault
committed
bareudp: Pull inner IP header on xmit.
JIRA: https://issues.redhat.com/browse/RHEL-59593 Upstream Status: linux.git commit c471236 Author: Guillaume Nault <gnault@redhat.com> Date: Wed Sep 11 11:21:05 2024 +0200 bareudp: Pull inner IP header on xmit. Both bareudp_xmit_skb() and bareudp6_xmit_skb() read their skb's inner IP header to get its ECN value (with ip_tunnel_ecn_encap()). Therefore we need to ensure that the inner IP header is part of the skb's linear data. Fixes: 571912c ("net: UDP tunnel encapsulation module for tunnelling different protocols like MPLS, IP, NSH etc.") Signed-off-by: Guillaume Nault <gnault@redhat.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://patch.msgid.link/267328222f0a11519c6de04c640a4f87a38ea9ed.1726046181.git.gnault@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Guillaume Nault <gnault@redhat.com>
1 parent 3c331af commit 8929c30

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/bareudp.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@ static int bareudp_xmit_skb(struct sk_buff *skb, struct net_device *dev,
323323
__be32 saddr;
324324
int err;
325325

326+
if (!skb_vlan_inet_prepare(skb, skb->protocol != htons(ETH_P_TEB)))
327+
return -EINVAL;
328+
326329
if (!sock)
327330
return -ESHUTDOWN;
328331

@@ -390,6 +393,9 @@ static int bareudp6_xmit_skb(struct sk_buff *skb, struct net_device *dev,
390393
__be16 sport;
391394
int err;
392395

396+
if (!skb_vlan_inet_prepare(skb, skb->protocol != htons(ETH_P_TEB)))
397+
return -EINVAL;
398+
393399
if (!sock)
394400
return -ESHUTDOWN;
395401

0 commit comments

Comments
 (0)