summaryrefslogtreecommitdiff
path: root/print-nsh.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-04-18 10:13:49 -0700
committerGuy Harris <guy@alum.mit.edu>2019-04-18 10:13:49 -0700
commit07a7f33ba3ff346b9ce31772645a06980baca907 (patch)
tree111a5a89cefb1c27e83b1aa4fb7a95e7c6163b8d /print-nsh.c
parent7c30120f52c22c1dd971431383ad2df8ca1a12c4 (diff)
downloadtcpdump-07a7f33ba3ff346b9ce31772645a06980baca907.tar.gz
Fix some narrowing warnings on LP64/LLP64 platforms.
Add a ND_BYTES_AVAILABLE_AFTER() macro to find the number of bytes available in the captured data, starting at the byte pointed to by the argument. It returns a u_int rather than a ptrdiff_t, so it'll be 32 bits on LP64 and LLP64 platforms as well as on ILP32 platforms. Use that macro. Make size-of-buffer arguments size_t. Cast some size_t and ptrdiff_t values to u_int or int.
Diffstat (limited to 'print-nsh.c')
-rw-r--r--print-nsh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/print-nsh.c b/print-nsh.c
index d752b247..17d62569 100644
--- a/print-nsh.c
+++ b/print-nsh.c
@@ -170,7 +170,7 @@ nsh_print(netdissect_options *ndo, const u_char *bp, u_int len)
ip6_print(ndo, bp, next_len);
break;
case 0x3:
- ether_print(ndo, bp, next_len, ndo->ndo_snapend - bp, NULL, NULL);
+ ether_print(ndo, bp, next_len, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL);
break;
default:
ND_PRINT("ERROR: unknown-next-protocol");