Commit Graph

5298 Commits

Author SHA1 Message Date
Francois-Xavier Le Bail
3b0b3f0def Add two EXTRACT_U_1() macro calls 2018-06-16 15:21:05 +02:00
Francois-Xavier Le Bail
52f7baee0c Fix a typo in the EXTRACT_BE_S_6() macro
S: Signed
2018-06-15 22:21:28 +02:00
Francois-Xavier Le Bail
484d4910a9 Update an email address 2018-06-13 17:49:23 +02:00
Francois-Xavier Le Bail
4dee61760d Add more nd_print_trunc() calls
Update the output of some tests accordingly.
2018-06-06 18:12:42 +02:00
Francois-Xavier Le Bail
94d2bf7fcc Include conditionally <config.h> in netdissect-alloc.c
This should suppress the warning reported by Gisle Vanem:

In file included from netdissect-alloc.c:18:
In file included from ./netdissect-alloc.h:22:
./netdissect.h(131,14):  warning: '_strdup' redeclared without 'dllimport'
    attribute: previous 'dllimport' ignored [-Winconsistent-dllimport]
extern char *strdup (const char *str);
             ^
./netdissect-stdinc.h(219,18):  note: expanded from macro 'strdup'
  #define strdup _strdup
                 ^
2018-06-05 14:38:15 +02:00
Francois-Xavier Le Bail
25621613e3 IP: Stop decoding when truncation occurs in options
We just keep the checksum control.
2018-06-05 09:27:00 +02:00
Francois-Xavier Le Bail
cca35090b7 UDP: Add two bounds checks 2018-06-04 13:46:10 +02:00
Francois-Xavier Le Bail
f28f87d6ee ICMPv6: Avoid reinventing ND_TCHECK_*() macros 2018-06-03 17:38:52 +02:00
Francois-Xavier Le Bail
1767655a9e IP: Print clearer when the version is invalid
Update the output of some tests accordingly.
2018-06-03 12:16:38 +02:00
Francois-Xavier Le Bail
a7fd3229d5 SUNRPC: Add a bounds check 2018-06-02 23:38:18 +02:00
Francois-Xavier Le Bail
663aa08e8b UDP: Add a bounds check 2018-06-02 16:31:49 +02:00
Francois-Xavier Le Bail
bd20ce304b VJC: Add some bounds checks 2018-06-02 14:06:22 +02:00
Francois-Xavier Le Bail
b1006d2e46 MPTCP: Add a bounds check 2018-06-02 09:32:56 +02:00
Francois-Xavier Le Bail
5fe61e70f1 Simplify some expressions
In the equality case, the difference is also zero.
2018-06-01 22:25:17 +02:00
Francois-Xavier Le Bail
b4503d7c31 Add more nd_print_trunc() calls
Update the output of some tests accordingly.

Moreover:
Add a ndo_protocol assignment in pimv2_print().
2018-06-01 16:20:56 +02:00
Francois-Xavier Le Bail
1f37b9f529 DCCP: Fix a truncation message
It's a truncated packet, not sure it's invalid.
2018-05-29 18:26:14 +02:00
Francois-Xavier Le Bail
ba255958e1 Make the NFLOG test case unconditional
There is no more HAVE_PCAP_NFLOG_H macro to test.

libpcap has support for NFLOG in current in 1.8.1 and in old releases
1.7.4, 1.6.2 and 1.5.3.

Thus there should be no problem to always do the test.
2018-05-29 13:56:26 +02:00
Francois-Xavier Le Bail
ee46167b27 Add a nd_print_trunc() call
Update the output of a test accordingly.
2018-05-29 12:03:48 +02:00
Francois-Xavier Le Bail
74d0778d0c ES-IS,IS-IS: Add two missing return
Update the output of some tests accordingly.
2018-05-25 17:12:45 +02:00
Francois-Xavier Le Bail
9e7cd40a7a UDP: Add two missing return 2018-05-25 13:21:43 +02:00
Francois-Xavier Le Bail
2897a032d0 Bluetooth: Add a missing return 2018-05-25 11:42:23 +02:00
Francois-Xavier Le Bail
e78cc7f2b1 We no longer need pcap/nflog.h nor pcap/bluetooth.h, step 2 2018-05-25 10:46:05 +02:00
Francois-Xavier Le Bail
38e32cdf14 Remove trailing spaces/tabs 2018-05-25 09:56:04 +02:00
Guy Harris
11736750e8 Update closing #endif comment. 2018-05-24 14:13:48 -07:00
Guy Harris
66384fa15b We no longer need pcap/nflog.h nor pcap/bluetooth.h. 2018-05-24 14:13:22 -07:00
Guy Harris
cde392ab16 Cast dport and sport to u_int before shifting them.
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.
2018-05-24 12:11:09 -07:00
Guy Harris
4ba56b8c2e Encrypted data buffer sizes must also be a multiple of the cipher block size.
This should address the issue in GitHub pull request #680.
2018-05-24 11:45:19 -07:00
Guy Harris
e7011808da Declare the NFLOG pseudo-header ourselves.
It's not specified by a libpcap header that might have a different
layout in different pcap releases, it's specified on the list of
link-layer header types and must remain the same forever (except for
getting additional bits defined), so we don't need to pick it up from
libpcap.

This means we get to use tcpdump's nd_ types; do so.
2018-05-23 14:43:47 -07:00
Guy Harris
e02efb5044 Declare the Bluetooth pseudo-header ourselves.
It's not specified by a libpcap header that might have a different
layout in different pcap releases, it's specified on the list of
link-layer header types and must remain the same forever (except for
getting additional bits defined), so we don't need to pick it up from
libpcap.

This means we get to use tcpdump's nd_ types; do so.
2018-05-23 14:12:45 -07:00
Francois-Xavier Le Bail
e73118bc07 Add more nd_print_trunc() calls
Update the output of some tests accordingly.

Moreover:
Update a ndo_protocol assignment.
2018-05-23 12:07:58 +02:00
Francois-Xavier Le Bail
03467d3e79 Add a nd_print_trunc() call
Moreover:
Rename a function with _print like in most similar cases
2018-05-23 09:55:36 +02:00
Francois-Xavier Le Bail
2b59fefb18 DECnet: Avoid using EXTRACT_ macros on non packet buffer pointers
Remove two now useless variables.
2018-05-22 13:49:07 +02:00
Francois-Xavier Le Bail
6df4852ec3 DCCP: Fix printing "Timestamp" and "Timestamp Echo" options
Add some comments.

Moreover:
Put a function definition name at the beginning of the line.
2018-05-22 11:31:46 +02:00
Francois-Xavier Le Bail
519a3f6636 Rx: Use the fn_print_str() function instead of nd_print()
We cannot use nd_print() because the parameter is not a pointer on the
packet buffer.
2018-05-20 18:49:26 +02:00
Francois-Xavier Le Bail
d5b451c089 Add more nd_print_trunc() calls
Update the output of a test accordingly.

Moreover:
Avoid printing useless '\n'.
2018-05-20 11:49:37 +02:00
Francois-Xavier Le Bail
4938de657c NTP: Fix extracting the poll value
Use EXTRACT_S_1 for ppoll (signed).
2018-05-20 08:13:27 +02:00
Francois-Xavier Le Bail
366dafcf78 DECnet: Pointers to packet bytes should be u_char *, not char * 2018-05-19 21:00:02 +02:00
Francois-Xavier Le Bail
3efcefafd8 Add a cast to the EXTRACT_U_1() macro
This change may avoid sign bit extension problem.
2018-05-19 20:43:35 +02:00
Francois-Xavier Le Bail
226c6a8d0f Replace some double parentheses with single parentheses 2018-05-19 20:33:37 +02:00
Guy Harris
87a92d9f28 Pointers to packet bytes should be u_char *, not char *. 2018-05-19 11:13:00 -07:00
Francois-Xavier Le Bail
6f2cd8cee6 timed: Fix bounds check when printing Machine Name 2018-05-19 12:36:55 +02:00
Francois-Xavier Le Bail
419cc7087b IEEE 802.11: Print the SSID with the fn_print_str() function
We cannot use nd_print() because the parameter is not a pointer on the
packet buffer.
2018-05-19 09:14:19 +02:00
Francois-Xavier Le Bail
7187e01f8f Add the fn_print_str() function
This function print a null-terminated string, filtering out non-printable
characters.
DON'T USE IT with a pointer on the packet buffer because there is no
truncation check. For this use, see the nd_printX() functions.
2018-05-18 23:05:01 +02:00
Francois-Xavier Le Bail
6e1fdd00a6 Add a nd_print_trunc() call
Replace a ND_TTEST_*() with ND_TCHECK_*().
Update the output of some tests accordingly.
2018-05-18 14:58:38 +02:00
Francois-Xavier Le Bail
34017c6fcb Add a nd_print_trunc() call
Moreover:
Replace a ND_TTEST_*() with ND_TCHECK_*().
2018-05-18 14:01:47 +02:00
Francois-Xavier Le Bail
bdad75a862 Replace some ND_TTEST_*() with ND_TCHECK_*() 2018-05-18 13:16:16 +02:00
Francois-Xavier Le Bail
480af1cdce Add more nd_print_trunc() calls
Update the output of some tests accordingly.
2018-05-18 11:39:52 +02:00
Francois-Xavier Le Bail
a1042c21e5 Use more the nd_print_trunc() call
Update the output of a test accordingly.
2018-05-18 11:16:21 +02:00
Francois-Xavier Le Bail
95e10b2026 TCP: Fix a closing string
It was ">", it must be "]"

Update the output of some tests accordingly.
2018-05-18 10:04:51 +02:00
Francois-Xavier Le Bail
45ecddd334 Fix space printing with istr[]
Because istr[] is assign to " (invalid)", avoid adding a space before it.

Moreover:
Avoid also useless '\n'
2018-05-18 10:03:59 +02:00