diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-04-18 10:13:49 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-04-18 10:13:49 -0700 |
commit | 07a7f33ba3ff346b9ce31772645a06980baca907 (patch) | |
tree | 111a5a89cefb1c27e83b1aa4fb7a95e7c6163b8d /print-olsr.c | |
parent | 7c30120f52c22c1dd971431383ad2df8ca1a12c4 (diff) | |
download | tcpdump-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-olsr.c')
-rw-r--r-- | print-olsr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/print-olsr.c b/print-olsr.c index 8e3adbbb..a8ab62f2 100644 --- a/print-olsr.c +++ b/print-olsr.c @@ -519,10 +519,10 @@ olsr_print(netdissect_options *ndo, case OLSR_MID_MSG: { - size_t addr_size = sizeof(nd_ipv4); + u_int addr_size = (u_int)sizeof(nd_ipv4); if (is_ipv6) - addr_size = sizeof(nd_ipv6); + addr_size = (u_int)sizeof(nd_ipv6); while (msg_tlen >= addr_size) { ND_TCHECK_LEN(msg_data, addr_size); |