]> The Tcpdump Group git mirrors - tcpdump/commit
Don't set the length of the attributes based on the snapshot length,
authorguy <guy>
Mon, 26 Sep 2005 01:01:55 +0000 (01:01 +0000)
committerguy <guy>
Mon, 26 Sep 2005 01:01:55 +0000 (01:01 +0000)
commitd8878f053df5026b9906b623a856aeba71026564
tree6e80d3fe76bf7b5b96220c5a669633778e0961e9
parentf35e1c7e7808bf85a22f36605101d17ead30761b
Don't set the length of the attributes based on the snapshot length,
just add some additional TCHECK/TCHECK2 bounds checks to the code that
dissects attributes and let that handle the snapshot length checks.

Do the length check once per attribute, rather than doing a single check
up front.

Use TCHECK/TCHECK2 and TTEST/TTEST2, so that we print "too short"
indications.  Make the "too short" indications all look the same.

Rename "radius_attr_print()" to "radius_attrs_print()" to make it
clearer that it has a loop to print all attributes, rather than just
printing one attribute.

As per Steiner Haug, the length of a vendor-specific attribute includes
the type and length bytes, so subtract two from the length to get the
length of the attribute's data.
print-radius.c