]> The Tcpdump Group git mirrors - tcpdump/commit
Update ND_BYTES_BETWEEN() macro for better accuracy
authorFrancois-Xavier Le Bail <[email protected]>
Mon, 29 May 2023 17:56:46 +0000 (19:56 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Mon, 12 Jun 2023 14:11:12 +0000 (16:11 +0200)
commitfb59931bfca6eed43f8aa0bbec37565fc3c084cb
treea214f2bac3f1f949c6924e98b007bc3f6b3273c5
parenta63600a1fc28dbc7ae7ce9f996829c49a25fb33c
Update ND_BYTES_BETWEEN() macro for better accuracy

Update the macro that computes how many bytes are present, starting
at the first argument and running up to (but not including) the second
argument, and returns that as a u_int (cutting it to 32 bits on LP64
and LLP64 platforms).

This reverses, for reasons of readability, the order of the arguments
which was based on old SMB's PTR_DIFF().

With this change the number of bytes "between" given by the macro is 0
when the first argument is greater than or equal to the second argument.

Update ND_BYTES_AVAILABLE_AFTER() accordingly.

This is a follow-up to f9c2c905b118b69a0b102549c1b25cca871947b5.
netdissect.h
print-bgp.c
print-isoclns.c
print-lwres.c
print-resp.c
print-smb.c
smbutil.c