]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fix up build warnings in queue-5.10/udp-gso-do-not-drop-small-packets-when-pmtu-reduc...
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Mar 2025 08:13:18 +0000 (09:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Mar 2025 08:13:18 +0000 (09:13 +0100)
queue-5.10/udp-gso-do-not-drop-small-packets-when-pmtu-reduces.patch

index f0a5c847071414935f98bf93c076d8b90c20b6c8..542398891c91e9d1eb48726e6fc4fe3a26e0d8dc 100644 (file)
@@ -27,52 +27,45 @@ Reviewed-by: Willem de Bruijn <willemb@google.com>
 Signed-off-by: David S. Miller <davem@davemloft.net>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- net/ipv4/udp.c                       |  4 ++--
- net/ipv6/udp.c                       |  4 ++--
- tools/testing/selftests/net/udpgso.c | 26 ++++++++++++++++++++++++++
+ net/ipv4/udp.c                       |    4 ++--
+ net/ipv6/udp.c                       |    4 ++--
+ tools/testing/selftests/net/udpgso.c |   26 ++++++++++++++++++++++++++
  3 files changed, 30 insertions(+), 4 deletions(-)
 
-diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
-index 6ad25dc9710c1..b801759147a68 100644
 --- a/net/ipv4/udp.c
 +++ b/net/ipv4/udp.c
-@@ -923,9 +923,9 @@ static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4,
+@@ -923,9 +923,9 @@ static int udp_send_skb(struct sk_buff *
                const int hlen = skb_network_header_len(skb) +
                                 sizeof(struct udphdr);
  
 -              if (hlen + cork->gso_size > cork->fragsize) {
-+              if (hlen + min(datalen, cork->gso_size) > cork->fragsize) {
++              if (hlen + min_t(int, datalen, cork->gso_size) > cork->fragsize) {
                        kfree_skb(skb);
 -                      return -EINVAL;
 +                      return -EMSGSIZE;
                }
                if (datalen > cork->gso_size * UDP_MAX_SEGMENTS) {
                        kfree_skb(skb);
-diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
-index 203a6d64d7e99..224339c3d831d 100644
 --- a/net/ipv6/udp.c
 +++ b/net/ipv6/udp.c
-@@ -1210,9 +1210,9 @@ static int udp_v6_send_skb(struct sk_buff *skb, struct flowi6 *fl6,
+@@ -1210,9 +1210,9 @@ static int udp_v6_send_skb(struct sk_buf
                const int hlen = skb_network_header_len(skb) +
                                 sizeof(struct udphdr);
  
 -              if (hlen + cork->gso_size > cork->fragsize) {
-+              if (hlen + min(datalen, cork->gso_size) > cork->fragsize) {
++              if (hlen + min_t(int, datalen, cork->gso_size) > cork->fragsize) {
                        kfree_skb(skb);
 -                      return -EINVAL;
 +                      return -EMSGSIZE;
                }
                if (datalen > cork->gso_size * UDP_MAX_SEGMENTS) {
                        kfree_skb(skb);
-diff --git a/tools/testing/selftests/net/udpgso.c b/tools/testing/selftests/net/udpgso.c
-index 7badaf215de28..0e137182a4f40 100644
 --- a/tools/testing/selftests/net/udpgso.c
 +++ b/tools/testing/selftests/net/udpgso.c
-@@ -94,6 +94,19 @@ struct testcase testcases_v4[] = {
-               .gso_len = CONST_MSS_V4,
+@@ -95,6 +95,19 @@ struct testcase testcases_v4[] = {
                .r_num_mss = 1,
        },
-+      {
+       {
 +              /* datalen <= MSS < gso_len: will fall back to no GSO */
 +              .tlen = CONST_MSS_V4,
 +              .gso_len = CONST_MSS_V4 + 1,
@@ -85,14 +78,14 @@ index 7badaf215de28..0e137182a4f40 100644
 +              .gso_len = CONST_MSS_V4 + 2,
 +              .tfail = true,
 +      },
-       {
++      {
                /* send a single MSS + 1B */
                .tlen = CONST_MSS_V4 + 1,
-@@ -197,6 +210,19 @@ struct testcase testcases_v6[] = {
-               .gso_len = CONST_MSS_V6,
+               .gso_len = CONST_MSS_V4,
+@@ -198,6 +211,19 @@ struct testcase testcases_v6[] = {
                .r_num_mss = 1,
        },
-+      {
+       {
 +              /* datalen <= MSS < gso_len: will fall back to no GSO */
 +              .tlen = CONST_MSS_V6,
 +              .gso_len = CONST_MSS_V6 + 1,
@@ -105,9 +98,7 @@ index 7badaf215de28..0e137182a4f40 100644
 +              .gso_len = CONST_MSS_V6 + 2,
 +              .tfail = true
 +      },
-       {
++      {
                /* send a single MSS + 1B */
                .tlen = CONST_MSS_V6 + 1,
--- 
-2.39.5
-
+               .gso_len = CONST_MSS_V6,