]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
vquic: handle SOCKEMSGSIZE correctly
authorStefan Eissing <stefan@eissing.org>
Tue, 27 Jan 2026 13:27:24 +0000 (14:27 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 28 Jan 2026 10:23:10 +0000 (11:23 +0100)
Report UDP packets with SOCKEMSGSIZE as being "sent" to progress
the send buffer properly on PMTUD probes.

Reported-by: Daniil Gentili
Fixes #20440
Closes #20448

lib/vquic/vquic.c

index 31a5297f35fef1342f9a92a021866a324537992e..5cf4b0f90cbbfa39fed28a02141b95bcf20bb50a 100644 (file)
@@ -168,6 +168,7 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf,
       return CURLE_AGAIN;
     case SOCKEMSGSIZE:
       /* UDP datagram is too large; caused by PMTUD. Just let it be lost. */
+      *psent = pktlen;
       break;
     case EIO:
       if(pktlen > gsolen) {
@@ -206,13 +207,13 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf,
       goto out;
     }
     else {
-      failf(data, "send() returned %zd (errno %d)", rv, SOCKERRNO);
       if(SOCKERRNO != SOCKEMSGSIZE) {
+        failf(data, "send() returned %zd (errno %d)", rv, SOCKERRNO);
         result = CURLE_SEND_ERROR;
         goto out;
       }
-      /* UDP datagram is too large; caused by PMTUD. Just let it be
-         lost. */
+      /* UDP datagram is too large; caused by PMTUD. Just let it be lost. */
+      *psent = pktlen;
     }
   }
 #endif