diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2017-08-30 09:23:01 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2017-08-30 09:23:01 +0000 |
commit | 4b04a42661a1514b0283568bc6cabe02a55d4c49 (patch) | |
tree | 74ed79937f92b365fa90f67e3b9e1457c11a1365 /usr.sbin/tcpdump | |
parent | 1167e2b036b1055eee2994630bc43efca158f1f3 (diff) |
unsigneds cannot be < 0; ok jca@
Diffstat (limited to 'usr.sbin/tcpdump')
-rw-r--r-- | usr.sbin/tcpdump/print-atalk.c | 4 | ||||
-rw-r--r-- | usr.sbin/tcpdump/print-bgp.c | 6 | ||||
-rw-r--r-- | usr.sbin/tcpdump/print-wb.c | 10 |
3 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/tcpdump/print-atalk.c b/usr.sbin/tcpdump/print-atalk.c index da49751f65a..d1c13781c64 100644 --- a/usr.sbin/tcpdump/print-atalk.c +++ b/usr.sbin/tcpdump/print-atalk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-atalk.c,v 1.32 2017/06/14 20:48:54 akfaew Exp $ */ +/* $OpenBSD: print-atalk.c,v 1.33 2017/08/30 09:23:00 otto Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -477,7 +477,7 @@ print_cstring(const char *cp, const u_char *ep) length = *cp++; /* Spec says string can be at most 32 bytes long */ - if (length < 0 || length > 32) { + if (length > 32) { (void)printf("[len=%d]", length); return (0); } diff --git a/usr.sbin/tcpdump/print-bgp.c b/usr.sbin/tcpdump/print-bgp.c index 5b1f866cbca..9fa40ed6369 100644 --- a/usr.sbin/tcpdump/print-bgp.c +++ b/usr.sbin/tcpdump/print-bgp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-bgp.c,v 1.24 2017/07/26 08:18:28 job Exp $ */ +/* $OpenBSD: print-bgp.c,v 1.25 2017/08/30 09:23:00 otto Exp $ */ /* * Copyright (C) 1999 WIDE Project. @@ -368,7 +368,7 @@ decode_prefix4(const u_char *pd, char *buf, u_int buflen) * enough bytes of address to contain this many bits */ plen = pd[0]; - if (plen < 0 || 32 < plen) + if (32 < plen) return -1; memset(&addr, 0, sizeof(addr)); TCHECK2(pd[1], (plen + 7) / 8); @@ -397,7 +397,7 @@ decode_prefix6(const u_char *pd, char *buf, u_int buflen) TCHECK(pd[0]); plen = pd[0]; - if (plen < 0 || 128 < plen) + if (128 < plen) return -1; memset(&addr, 0, sizeof(addr)); diff --git a/usr.sbin/tcpdump/print-wb.c b/usr.sbin/tcpdump/print-wb.c index d43d8597d12..d249a69ac00 100644 --- a/usr.sbin/tcpdump/print-wb.c +++ b/usr.sbin/tcpdump/print-wb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-wb.c,v 1.9 2015/11/16 00:16:39 mmcc Exp $ */ +/* $OpenBSD: print-wb.c,v 1.10 2017/08/30 09:23:00 otto Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996 @@ -180,7 +180,7 @@ wb_id(const struct pkt_id *id, u_int len) printf(" wb-id:"); len -= sizeof(*id); - if (len < 0 || (u_char *)(id + 1) > snapend) + if ((u_char *)(id + 1) > snapend) return (-1); printf(" %u/%s:%u (max %u/%s:%u) ", @@ -336,7 +336,7 @@ wb_rrep(const struct pkt_rrep *rrep, u_int len) printf(" wb-rrep:"); len -= sizeof(*rrep); - if (len < 0 || (u_char *)(rrep + 1) > snapend) + if ((u_char *)(rrep + 1) > snapend) return (-1); printf(" for %s %s:%u<%u:%u>", @@ -357,7 +357,7 @@ wb_drawop(const struct pkt_dop *dop, u_int len) { printf(" wb-dop:"); len -= sizeof(*dop); - if (len < 0 || (u_char *)(dop + 1) > snapend) + if ((u_char *)(dop + 1) > snapend) return (-1); printf(" %s:%u<%u:%u>", @@ -382,7 +382,7 @@ wb_print(const void *hdr, u_int len) ph = (const struct pkt_hdr *)hdr; len -= sizeof(*ph); - if (len < 0 || (u_char *)(ph + 1) <= snapend) { + if ((u_char *)(ph + 1) <= snapend) { if (ph->ph_flags) printf("*"); switch (ph->ph_type) { |