BUILD: quic: Compilation issue on 32-bits systems with quic_may_send_bytes()
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 23 Aug 2023 14:13:54 +0000 (16:13 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Tue, 5 Sep 2023 08:33:56 +0000 (10:33 +0200)
quic_may_send_bytes() implementation arrived with this commit:

  MINOR: quic: Amplification limit handling sanitization.

It returns a size_t. So when compared with QUIC_MIN() with qc->path->mtu there is
no need to cast this latted anymore because it is also a size_t.

Detected when compiled with -m32 gcc option.

src/quic_tx.c

index c414e2c..46dd6ba 100644 (file)
@@ -504,7 +504,7 @@ static int qc_prep_app_pkts(struct quic_conn *qc, struct buffer *buf,
                        end = pos + QUIC_MIN_CC_PKTSIZE;
                }
                else if (!quic_peer_validated_addr(qc) && qc_is_listener(qc)) {
-                       end = pos + QUIC_MIN((uint64_t)qc->path->mtu, quic_may_send_bytes(qc));
+                       end = pos + QUIC_MIN(qc->path->mtu, quic_may_send_bytes(qc));
                }
                else {
                        end = pos + qc->path->mtu;
@@ -1112,7 +1112,7 @@ int qc_prep_hpkts(struct quic_conn *qc, struct buffer *buf, struct list *qels)
                                        end = pos + QUIC_MIN_CC_PKTSIZE;
                                }
                                else if (!quic_peer_validated_addr(qc) && qc_is_listener(qc)) {
-                                       end = pos + QUIC_MIN((uint64_t)qc->path->mtu, quic_may_send_bytes(qc));
+                                       end = pos + QUIC_MIN(qc->path->mtu, quic_may_send_bytes(qc));
                                }
                                else {
                                        end = pos + qc->path->mtu;