| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Remove also two unnecessary ND_TCHECK_SIZE().
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make a few one-byte fetches use GET_U_1().
In ospf_print_tos_metrics() lose an excess ND_TCHECK_SIZE() and make the
function void.
Make ospf_decode_lls() void -- the only case when it returned a non-zero
value was if the LLS block is invalid, and it already signals that with a
message. It is a separate matter if the invalid packet is also truncated,
and since there is no proper check for that, just return without printing
a misleading message.
Switch ospf_print() to nd_trunc_longjmp().
|
|
|
|
|
|
|
| |
Bit 0x10 was once going to be EA-bit, but eventually was allocated to
L-bit instead, so remove the EA-bit. Bit 0x01 was allocated to T-bit,
which was later renamed to MT-bit, so rename it. Make some indentation
consistent.
|
|
|
|
|
|
|
|
|
|
|
| |
ND_TCHECK_4(e).
They are redundant because they are followed by a GET_IPADDR_STRING(e)
call, same e, which do the bounds check.
Remove unused 'trunc' labels and associated codes.
Update the output of a test accordingly.
|
|
|
|
|
|
|
| |
Remove a number of instances that do not match common patterns and have
the only substantial effect on the code flow that a truncated packet
triggers "goto trunc" instead of longjmp(). (In a few cases this change
can increase the number of fields printed before giving up.)
|
|
|
|
|
|
|
|
|
|
|
| |
ND_TCHECK_n(e), n in { 1, 2, 3, 4, 8 }.
They are redundant because they are followed by a GET_.*_n(e) call,
same n, same e, which do the bounds check.
Remove unused 'trunc' labels and most associated codes.
Update the outputs of some tests accordingly.
|
|
|
|
|
|
|
|
| |
Make lengths unsigned, and note some cases where it's known that
subtracting an item size from the length will not underflow.
Redo a loop so that it stops as soon as the count goes to zero and
doesn't decrement, and thus underflow, its value once it goes to zero.
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the loop for LS_OPAQUE_TE_TLV_LINK, loop until the remaining TLV
length is 0; we're already checking, first thing in the loop, that the
remaining length is at least 4, so we can process the T and the L.
For each sub-TLV of LS_OPAQUE_TE_TLV_LINK, make sure the sub-tlV doesn't
go past the end of the TLV.
If we compute the padded TLV or sub-TLV length, redo the check, to make
sure the padded length isn't too big.
|
|
|
|
|
|
| |
Modifying it means that the "print the LSA in hex" code will only print
what remains of the LSA - unlike other LSAs, where it's printed in its
entirety.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace more calls to ipaddr_string()/ip6addr_string() with calls to
GET_IPADDR_STRING()/GET_IP6ADDR_STRING() macros performing bounds
checking.
Add similar bounds-checking inline functions and macros to wrap
linkaddr_string(), etheraddr_string(), and isonsap_string() and convert
calls to them to use the macros as well.
Shuffle the inline functions in addrtoname.h around a bit, so that the
inline functions, external declarations, and macros are all in the same
order.
|
| |
|
|
|
|
|
|
|
| |
The exceptions are currently:
Some EXTRACT_ in print-juniper.c, not used on packet buffer pointer.
An EXTRACT_BE_U_3 in addrtoname.c, not always used on packet buffer
pointer.
|
|
|
|
|
|
|
| |
It prints " (invalid)", used for malformed or corrupted packets.
Moreover:
Update CONTRIBUTING.
|
|
|
|
|
|
|
|
| |
Remove the tstr[] strings.
Update the output of some tests accordingly.
Moreover:
Add or update some ndo_protocol fields.
|
|
|
|
| |
Use the nd_printzp() function instead.
|
|
|
|
|
| |
Update this field in printer entry functions.
It will be used for some printings.
|
|
|
|
|
| |
Moreover:
Fix spaces.
|
| |
|
|
|
|
| |
Fix warnings that introduces.
|
|
|
|
|
| |
It may do less work than EXTRACT_IPV4_TO_HOST_ORDER(), and the byte
order doesn't matter when comparing against 0.
|
|
|
|
|
|
| |
This ensures that we have no purportedly-aligned-but-not-necessarily-
unaligned values that we access; we have to use EXTRACT_ macros/functions
to get at IPv4 address values.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This can prevent bizarre failures if, for example, you've done a
configuration in the top-level source directory, leaving behind one
config.h file, and then do an out-of-tree build in another directory,
with different configuration options. This way, we always pick up the
same config.h, in the build directory.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
For various opaque LSAs, not only is the value of the TLV a "may
repeat", the TLVs *themselves* may repeat.
Also, pass a pointer to the TLV to ospf_print_grace_lsa() and
ospf_print_te_lsa(), rather than a pointer to the type field, as they
dissect a sequence of TLVs.
Hopefully, that will address Coverity CID 1426916, 1426917, and 1426920.
|
|
|
|
|
| |
ND_TCHECK(*lp) test for only one byte.
A test for four bytes is needed.
|
|
|
|
|
|
| |
And add EXTRACT_ calls as required.
Remove no-longer-necessary & operators in EXTRACT_ calls.
|
|
|
|
|
|
| |
Let the compiler do the optimizations (or not) based on build options.
Avoid 'value has been optimized out' messages in gdb using '-O0'.
|
|
|
|
|
| |
ND_TTEST2(var, l) -> ND_TTEST_LEN(p, l)
ND_TCHECK2(var, l) -> ND_TCHECK_LEN(p, l)
|
| |
|
|
|
|
|
|
| |
In ND_PRINT() macro call(s) (step 9).
*(p)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now all the macros have a name meaning a count in bytes.
With _S_: signed, _U_: unsigned
e.g.:
EXTRACT_BE_32BITS -> EXTRACT_BE_U_4
EXTRACT_LE_32BITS -> EXTRACT_LE_U_4
...
EXTRACT_BE_INT32 -> EXTRACT_BE_S_4
and have:
EXTRACT_8BITS -> EXTRACT_U_1
EXTRACT_INT8 -> EXTRACT_S_1
|
|
|
|
| |
In tok2str() calls.
|
|
|
|
| |
In bittok2str() calls.
|
|
|
|
|
| |
It indicates clearly that these macros are used to extract big-endian
integral values.
|
|
|
|
|
|
| |
As far as modern OSPF implementations are concerned, packet type 0 is
not a valid value, so let's print it as such. Also for an invalid packet
type tell its decimal value.
|
|
|
|
| |
The bounds check for the Hello packet options was missing.
|
|
|
|
|
|
|
|
| |
with the tag '\summary:' for greping.
Remark: Currently some printers have no summary line.
Moreover:
Summarize all printers with a single line in INSTALL.txt
|