]> The Tcpdump Group git mirrors - tcpdump/commit
OpenFlow 1.0: Lose 7 ND_TCHECK_LEN() calls.
authorDenis Ovsienko <[email protected]>
Wed, 16 Sep 2020 00:38:07 +0000 (01:38 +0100)
committerDenis Ovsienko <[email protected]>
Wed, 16 Sep 2020 00:38:07 +0000 (01:38 +0100)
commit503c7d1dc16961fdd8a3f62aea688cab270328e9
tree27dda3be500f5d881fdfd8ec46cf3c380b5ee59c
parent0a5faecf953a8a997b0e90e0bed1d763542166e0
OpenFlow 1.0: Lose 7 ND_TCHECK_LEN() calls.

Considering a protocol field that has a known size and contains a
zero-padded string, in a code of this particular form:

ND_TCHECK_LEN(field_start, field_length);
nd_print(ndo, field_start, field_start + field_length);

...the only effect of the ND_TCHECK_LEN() call is that when the protocol
field is not entirely within the packet buffer, the code before
triggering a longjmp() prints nothing instead of printing the part of
the field that is within the packet buffer. Thus remove these instances
of ND_TCHECK_LEN(), so the output better represents the captured data.
print-openflow-1.0.c