| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Fix this cppcheck warning:
print-tcp.c:711:20: warning: Checking if unsigned expression 'length'
is less than zero. [unsignedLessThanZero]
if (length <= 0)
^
|
|
|
|
|
|
| |
Like all other text protocols.
This is a follow-up to 185b7ce04b182d2d7e490f23a3f0c7b9ea5916e4.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's explicitly cheating in some places; just cast away the warnings.
Add a Clang version testing macro to compiler-tests.h.
Move the diagnostic control #defines from netdissect-stdinc.h to
diag-control.h, libpcap-style, so that they can be used by code that
doesn't use (or need) netdissect-stdinc.h. This also means that we can
limit the inclusion of diag-control.h, and the definition of those
Do them more libpcap-style, with separate DIAG_OFF/DIAG_ON pairs for
particular issues, rather than having DIAG_OFF() and DIAG_ON() macros
that take -W option names as arguments; that way, if we need to define
them for compilers that don't have the GCC/Clang syntax for those
pragmas, e.g. MSVC, we can do so.
|
|
|
|
|
|
| |
This is a follow-up to commit 568d18f6eafb8df0d2500652b1cad49618051349.
[skip ci]
|
|
|
|
|
|
|
|
| |
At least the header data is required.
Moreover:
Update the output of a test accordingly.
Fix indentation.
|
|
|
|
|
|
|
| |
Update the snapend to the end of the option before calling mptcp_print().
Some options (MPTCP or others) may be present after a MPTCP option.
This prevents that, in mptcp_print(), the remaining length < the remaining
caplen.
|
|
|
|
|
|
|
|
|
|
| |
Enable ND_LONGJMP_FROM_TCHECK. Report invalid packets as invalid. Remove
most ND_TCHECK*() instances as they were redundant. Update a custom
snapend guard to use nd_trunc_longjmp(). Reduce arity of
print_tcp_fastopen_option(). Use ND_TTEST_LEN() in
tcp_verify_signature() and nd_printn() in print_tcp_rst_data(). For
NFS_PORT remove ND_TTEST_4() from the test condition as it is not a
valid factor, there is the subsequent GET_BE_U_4() to check bounds.
|
|
|
|
| |
This way there is less code duplication and more consistency.
|
|
|
|
|
| |
This automatically fixes a few error messages that would tell an
incorrect function name.
|
|
|
|
|
|
| |
Replace the calls to ipaddr_string()/ip6addr_string() with calls to
GET_IPADDR_STRING()/GET_IP6ADDR_STRING() macros performing bounds
checking.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
The length is tested in ldp_print().
|
|
|
|
|
|
|
|
| |
Add the parameter 'over_tcp'.
Move the shift by 2 bytes from the TCP printer to the DNS printer.
Move adding a prepended space from the TCP printer to the DNS printer.
Add a length check.
Add some comments about 'over_tcp' and 'is_mdns' call values.
|
|
|
|
| |
[skip ci]
|
|
|
|
|
|
| |
This allows tcpdump to handle DNS running on non-standard ports.
Add two test files with DNS over TCP and DNS over UDP, port 8053.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
If there isn't an IPv6 payload, there isn't any TCP or UDP packet, and
there's no TCP or UDP header to checksum, so there's no need for the
check (it's not there for IPv4).
|
|
|
|
|
|
|
|
|
|
|
| |
... and a Clang warning.
The warning was:
./print-tcp.c:402:120: warning: address of array
'ip6->ip6_ctlun.ip6_un1.ip6_un1_plen' will always evaluate to 'true'
[-Wpointer-bool-conversion]
...& 0xf0) >> 4) == 6 && ip6->ip6_ctlun.ip6_un1.ip6_un1_plen) {
~~ ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Moreover:
Fix a truncated string: "[!" is not the prefix for a truncated string.
Add two comments.
Clean up a whitespace.
|
| |
|
|
|
|
|
|
| |
The error was:
print-tcp.c:831:22: runtime error: unsigned integer overflow: 0 - 1
cannot be represented in type 'u_int' (aka 'unsigned int')
|
|
|
|
|
| |
Use a u_char variable for characters in the RST string; no need for it
to be an int.
|
|
|
|
|
| |
Those checksums are 16-bit; change the return types of those routines
appropriately.
|
| |
|
| |
|
| |
|
|
|
|
| |
[skip ci]
|
|
|
|
|
|
|
|
| |
The result of the expression is ultimately going to be put into a u_int;
cast them to u_int so that we'll be shifting unsigned values left rather
than int values, to avoid undefined behavior.
This should fix GitHub issue #681.
|
|
|
|
|
|
| |
It was ">", it must be "]"
Update the output of some tests accordingly.
|
|
|
|
| |
Update the output of some tests accordingly.
|
| |
|
|
|
|
|
|
| |
Print the characters filtering out non-printable with fn_print_char().
Update the output of some tests accordingly.
|
| |
|
|
|
|
|
| |
Update this field in printer entry functions.
It will be used for some printings.
|
|
|
|
|
|
|
| |
The status are defined in an enum in status-exit-codes.h.
Moreover:
Use ndo_error() instead of ndo_warning() for malloc() errors in print-esp.c.
|
| |
|
|
|
|
| |
Use parens around the sizeof argument, to match the style used elsewhere.
|
| |
|
| |
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|