diff options
author | pkelsey <pkelsey@FreeBSD.org> | 2015-07-08 23:57:58 +0000 |
---|---|---|
committer | pkelsey <pkelsey@FreeBSD.org> | 2015-07-08 23:57:58 +0000 |
commit | b23b1a18f0d1e3cf77b0e61d66e95659206c3391 (patch) | |
tree | 134985140c743138cf03196b028344b9c4876bdb /contrib/tcpdump/netdissect.h | |
parent | d374814126e00f3e20429c6336f1fc7fd6617491 (diff) | |
download | FreeBSD-src-b23b1a18f0d1e3cf77b0e61d66e95659206c3391.zip FreeBSD-src-b23b1a18f0d1e3cf77b0e61d66e95659206c3391.tar.gz |
MFV r285292:
Merge upstream fix to eliminate build-breaking gcc warnings of no
importance.
commit: cab33b7a0acba7d2268a23c4383be6167106e549
Update ND_TTEST2 to fix issue 443
Add IS_NOT_NEGATIVE macro.
Avoid these warnings:
- comparison of unsigned expression >= 0 is always true [-Wtype-limits],
- comparison is always true due to limited range of data type [-Wtype-limits].
Reviewed by: adrian
Approved by: jmallett (mentor)
MFC after: 1 month
Diffstat (limited to 'contrib/tcpdump/netdissect.h')
-rw-r--r-- | contrib/tcpdump/netdissect.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/tcpdump/netdissect.h b/contrib/tcpdump/netdissect.h index bc120c3..0cd7c12 100644 --- a/contrib/tcpdump/netdissect.h +++ b/contrib/tcpdump/netdissect.h @@ -270,8 +270,11 @@ struct netdissect_options { * * http://www.kb.cert.org/vuls/id/162289 */ + +#define IS_NOT_NEGATIVE(x) (((x) > 0) || ((x) == 0)) + #define ND_TTEST2(var, l) \ - ((l) >= 0 && \ + (IS_NOT_NEGATIVE(l) && \ ((uintptr_t)ndo->ndo_snapend - (l) <= (uintptr_t)ndo->ndo_snapend && \ (uintptr_t)&(var) <= (uintptr_t)ndo->ndo_snapend - (l))) |