| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
A bunch of DLT_JUNIPER_ values were not being handled in the "DLT_
specific parsing" switch statement; add (empty) cases for them.
|
|
|
|
|
|
| |
l2info.cookie is not inside the packet - it's a copy of data from the
packet, with the copy doing the necessary bounds checking - so we
shouldn't use NT_TCHECK or GET macros on it.
|
|
|
|
|
|
|
|
|
|
| |
In the loop searching through the cookie table, just search for a
matching entry and, if we find one, save the entry and break out of the
loop.
If we found a matching entry, process the cookie using that entry.
That way, the cookie processing isn't buried in a loop.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ICHECK like Invalid-Check.
Reminder: If the checked expression is true an error message is printed
and a 'goto invalid' is executed.
This change adds the parameter 'operator'.
Before this change, '<' comparison was hard coded.
We can do now:
ND_ICHECK_U(length, <, HEADER_LEN);
ND_ICHECK_U(length, ==, 24);
ND_ICHECK_U(length, !=, 8);
ND_ICHECK_ZU(length, <, sizeof(struct my_struct));
ND_ICHECKMSG_U("message length", msg_tlen, <, 4);
...
(Any comparison operator)
Remark: The change of names from ND_LCHECK*() to ND_ICHECK*() is
because something else than a length(L) can be checked.
Moreover:
Place the 'message' parameter at the beginning of ND_ICHECKMSG_U()
and ND_ICHECKMSG_ZU() paramaters lists.
|
|
|
|
| |
Update the output of a test accordingly.
|
|
|
|
|
| |
This change allows to have a better error message at the next commit
with ND_LCHECK_U().
|
|
|
|
| |
This is a follow-up to 880b867ee73ae757faebbab13213c7d4079222a5.
|
|
|
|
|
|
|
|
| |
Avoid to have p (current pointer on packet data) > ndo->ndo_snapend
in isoclns_print() in some cases.
Define ND_LONGJMP_FROM_TCHECK.
Remove some trunc labels.
|
|
|
|
|
|
| |
This change fixes the GH issue #801.
Same way as commit 88135db7c785661e7a8b0c02d3ef0bfd00cce6aa.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's the only case where ndo->ndo_eflag is tested > 1.
It's not documented we could use -ee[...].
To print more details, we already have -v[v]... (if needed).
Using -e[e]... could add some confusion.
This also add more complexity on a test matrix:
('', '-v', '-e', '-ve', -'vee', -vve, '-vvee', etc.).
Thus replace this only case by ndo->ndo_eflag to only have to test
ndo_eflag == 0 or ndo_eflag == 1.
|
|
|
|
|
| |
This change add back 4 ND_TCHECK_n() because their removal may be unsafe.
(via Denis comment)
|
|
|
|
|
|
|
|
|
| |
ND_TCHECK_n(e).
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' label(s) and most associated code(s).
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
It's a follow-up to commit 81dbf4a0b05092760d0ff0cdd48c692e4769ba99.
There is no need to update ether_print(), ether_common_print() and
ether_switch_tag_print() to void functions: back to u_int functions.
There is also no need to add a flag parameter to ether_print(),
ether_common_print() and ether_switch_tag_print(): Remove it.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
brcm_tag_if_print()
brcm_tag_prepend_if_print()
dsa_if_print()
edsa_if_print()
ether_if_print()
netanalyzer_if_print()
netanalyzer_transparent_if_print()
Update ether_print(), ether_common_print() and ether_switch_tag_print()
to void functions.
Add a flag parameter to ether_print(), ether_common_print() and
ether_switch_tag_print() to increment the link-layer header length field
of the netdissect_options when needed.
The calls use TRUE when the return value of the funtions was used.
The calls with FALSE avoid increments when the calls are nested.
Moreover:
Remove trailing "_if" from some protocol names.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 error was:
print-juniper.c:1407:21: runtime error: index 8 out of bounds for
type 'uint8_t [8]'
Thix fixes GitHub issue #783.
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This parameter will be needed at the next step.
|
| |
|
|
|
|
|
|
| |
"_if", in function names, is just a convention used for the top-level
routine for a given DLT_ value; it's not part of the protocol name for
the link-layer type.
|
|
|
|
| |
Wrap everyting in the big #if.
|
|
|
|
|
| |
Some stuff is used only by certain dissectors; define/declare it only if
the dissectors that use it are being compiled.
|
|
|
|
| |
Update the output of some tests accordingly.
|
| |
|
|
|
|
|
| |
Update this field in printer entry functions.
It will be used for some printings.
|
|
|
|
| |
Fix warnings that introduces.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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)
|
|
|
|
| |
Assignment, p[n], (more)
|
|
|
|
| |
Assignment, p[n]
|
| |
|
| |
|
|
|
|
| |
In: if (... p[n] ...) ...
|
|
|
|
| |
In: switch (... p[n] ...) ...
|
|
|
|
|
|
| |
In ND_PRINT() macro call(s) (step 7).
p[n] ...
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Now all the macros have a name meaning a count in bytes.
e.g.:
ND_TCHECK_32BITS -> ND_TCHECK_4
ND_TTEST_32BITS -> ND_TTEST_4
|
|
|
|
|
|
|
| |
Assignment, *p++ -> EXTRACT_8BITS(p); p++;
Assignment, *(p++) -> EXTRACT_8BITS(p); p++;
Partial list.
|