diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-02-26 23:32:50 +0100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-02-26 23:32:50 +0100 |
commit | bd7340e815814736fd4effdf2fed5452d9e17c23 (patch) | |
tree | 361fcc1e8790d5a012caacb009a1b0390bb50884 | |
parent | 601f7ee78ece7d54a12cf9191d23a3ec516d8948 (diff) | |
download | passt-bd7340e815814736fd4effdf2fed5452d9e17c23.tar passt-bd7340e815814736fd4effdf2fed5452d9e17c23.tar.gz passt-bd7340e815814736fd4effdf2fed5452d9e17c23.tar.bz2 passt-bd7340e815814736fd4effdf2fed5452d9e17c23.tar.lz passt-bd7340e815814736fd4effdf2fed5452d9e17c23.tar.xz passt-bd7340e815814736fd4effdf2fed5452d9e17c23.tar.zst passt-bd7340e815814736fd4effdf2fed5452d9e17c23.zip |
tap: Cast ETH_MAX_MTU to signed in comparisons
At least gcc 8.3 and 10.2 emit a warning on armv6l and armv7l.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | tap.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -658,7 +658,7 @@ redo: /* Complete the partial read above before discarding a malformed * frame, otherwise the stream will be inconsistent. */ - if (len < (ssize_t)sizeof(*eh) || len > ETH_MAX_MTU) + if (len < (ssize_t)sizeof(*eh) || len > (ssize_t)ETH_MAX_MTU) goto next; pcap(p, len); @@ -718,7 +718,7 @@ restart: while ((len = read(c->fd_tap, pkt_buf + n, TAP_BUF_BYTES - n)) > 0) { struct ethhdr *eh = (struct ethhdr *)(pkt_buf + n); - if (len < (ssize_t)sizeof(*eh) || len > ETH_MAX_MTU) { + if (len < (ssize_t)sizeof(*eh) || len > (ssize_t)ETH_MAX_MTU) { n += len; continue; } |