Skip to content

Commit cd8892c

Browse files
author
Paolo Abeni
committed
Merge branch 'gtp-tunnel-driver-fixes'
Pablo Neira Ayuso says: ==================== GTP tunnel driver fixes The following patchset contains two fixes for the GTP tunnel driver: 1) Incorrect GTPA_MAX definition in UAPI headers. This is updating an existing UAPI definition but for a good reason, this is certainly broken. Similar fixes for incorrect _MAX definition in netlink headers were applied in the past too. 2) Fix GTP driver PMTU with GRO packets, add missing call to skb_gso_validate_network_len() to handle GRO packets. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2 parents 9644bc4 + 4530e5b commit cd8892c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

drivers/net/gtp.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,8 +872,9 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev,
872872

873873
skb_dst_update_pmtu_no_confirm(skb, mtu);
874874

875-
if (!skb_is_gso(skb) && (iph->frag_off & htons(IP_DF)) &&
876-
mtu < ntohs(iph->tot_len)) {
875+
if (iph->frag_off & htons(IP_DF) &&
876+
((!skb_is_gso(skb) && skb->len > mtu) ||
877+
(skb_is_gso(skb) && !skb_gso_validate_network_len(skb, mtu)))) {
877878
netdev_dbg(dev, "packet too big, fragmentation needed\n");
878879
icmp_ndo_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
879880
htonl(mtu));

include/uapi/linux/gtp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ enum gtp_attrs {
3333
GTPA_PAD,
3434
__GTPA_MAX,
3535
};
36-
#define GTPA_MAX (__GTPA_MAX + 1)
36+
#define GTPA_MAX (__GTPA_MAX - 1)
3737

3838
#endif /* _UAPI_LINUX_GTP_H_ */

0 commit comments

Comments
 (0)