summaryrefslogtreecommitdiff
path: root/print-vxlan-gpe.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-vxlan-gpe.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-vxlan-gpe.c')
-rw-r--r--print-vxlan-gpe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/print-vxlan-gpe.c b/print-vxlan-gpe.c
index 1364534e..d7a80f25 100644
--- a/print-vxlan-gpe.c
+++ b/print-vxlan-gpe.c
@@ -92,7 +92,7 @@ vxlan_gpe_print(netdissect_options *ndo, const u_char *bp, u_int len)
ip6_print(ndo, bp, len - VXLAN_GPE_HDR_LEN);
break;
case 0x3:
- ether_print(ndo, bp, len - VXLAN_GPE_HDR_LEN, ndo->ndo_snapend - bp, NULL, NULL);
+ ether_print(ndo, bp, len - VXLAN_GPE_HDR_LEN, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL);
break;
case 0x4:
nsh_print(ndo, bp, len - VXLAN_GPE_HDR_LEN);