From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH 02/22] tap, tcp: Fix two comparisons with different signedness reported by gcc 7 Date: Fri, 28 Jan 2022 19:33:37 +0100 Message-ID: <20220128183357.3407606-3-sbrivio@redhat.com> In-Reply-To: <20220128183357.3407606-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5022317108471820981==" --===============5022317108471820981== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable For some reason, those are not reported by recent versions of gcc. Signed-off-by: Stefano Brivio --- tap.c | 2 +- tcp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tap.c b/tap.c index d6bad5a..a3fc249 100644 --- a/tap.c +++ b/tap.c @@ -340,7 +340,7 @@ resume: iph =3D (struct iphdr *)(eh + 1); if ((iph->ihl * 4) + sizeof(*eh) > len) continue; - if (iph->ihl * 4 < sizeof(*iph)) + if (iph->ihl * 4 < (int)sizeof(*iph)) continue; =20 if (iph->saddr && c->addr4_seen !=3D iph->saddr) { diff --git a/tcp.c b/tcp.c index b0d5f40..2a842bd 100644 --- a/tcp.c +++ b/tcp.c @@ -1034,7 +1034,7 @@ static int tcp_opt_get(struct tcphdr *th, size_t len, u= int8_t type_search, uint8_t type, optlen; char *p; =20 - if (len > th->doff * 4) + if (len > (unsigned)th->doff * 4) len =3D th->doff * 4; =20 len -=3D sizeof(*th); --=20 2.33.0 --===============5022317108471820981==--