Commit Graph

6960 Commits

Author SHA1 Message Date
Guy Harris
6a681e6a16 Have routines that set the snapend take a buffer pointer and length as args.
Have nd_push_buffer() take a snapshot length, not a snapshot end, as
its last argument.

Replace nd_push_snapend() and nd_change_snapend() with nd_push_snaplen()
and nd_change_snaplen(), both of which take a pointer into the packet
buffer and snapshot length relative to that pointer as arguments.  Have
those routines check the snapshot length to make sure it's not bigger
than the number of bytes in the packet past the pointer, and silently
ignore the requst if it is.

Using a length rather than a pointer avoids the possibility of the
calculation of the snapshot end overflowing and resulting in a snapshot
end *before* the point in the buffer.

Add a test for this, with a capture file containing an IPv6 packet with
an extremely large "jumbo" packet size.

Revert the "Make sure we don't set the snapend before the beginning of
the packet." changes, as they no longer apply with this change (which
also makes sure we don't set the snapend before the beginning of the
packet).
2022-03-31 02:29:19 -07:00
Francois-Xavier Le Bail
6bd6fe4663 Remove four test files
These pcap(ng) files were not tcpdump test files but libpcap test files.
They are now in the libpcap tests directory.
2022-03-30 17:08:19 +02:00
Guy Harris
be43281053 Make sure we don't set the snapend before the beginning of the packet.
If a caller attempts to set it after the current snapend, just silently
ignore the attempt.

If they try to set it before the beginning of the packet, report it as a
bug and quit dissection.  Add a new setjmp() return value meaning "bug"
rather than "truncated packet", add an "nd_bug_longjmp()" routine for
reporting bugs where we should quit dissecting, and use that in this
case.
2022-03-29 00:51:21 -07:00
Guy Harris
518e1bf60b Move nd_trunc_longjmp() to netdissect.h with the other nd_ functions.
It's not particularly tied to the data-extraction functions; this makes
it available elsewhere.
2022-03-28 12:44:50 -07:00
Francois-Xavier Le Bail
7e36f44fe6 Kerberos: Print the protocol name
Update the output of three tests accordingly.
2022-03-25 14:18:36 +01:00
Francois-Xavier Le Bail
f5378f49b3 Kerberos: Remove a redundant bounds check 2022-03-25 09:08:59 +01:00
Francois-Xavier Le Bail
34d8e7fbf5 CHANGES: Add more changes that has been backported to 4.99.2 2022-03-20 22:45:00 +01:00
Francois-Xavier Le Bail
e2331fa72f CHANGES: About optional unit suffix on -C file size [skip ci] 2022-03-20 21:17:36 +01:00
Francois-Xavier Le Bail
1573720345 CHANGES: Add more changes that has been backported to 4.99.2 2022-03-20 21:05:29 +01:00
Guy Harris
903e8ac4a7 CHANGES: move a change that has been backported to 4.99.2. [skip ci] 2022-03-20 12:13:17 -07:00
Guy Harris
afc13c9721 CHANGES: add more OpenFlow fixes to the list. [skip ci] 2022-03-20 12:08:27 -07:00
Francois-Xavier Le Bail
2e06d61ad4 CHANGES: Add change about config.{guess,sub} update now in 4.99.2 [skip ci] 2022-03-20 18:29:01 +01:00
Francois-Xavier Le Bail
0a35fb1d2a CHANGES: Add changes about outputs of -J/-L to stdout 2022-03-20 17:06:43 +01:00
Francois-Xavier Le Bail
9a530d8876 CHANGES: Add change about new configure option to help debugging 2022-03-20 14:32:17 +01:00
Guy Harris
d348efe8bd CHANGES: add a main-only change. [skip ci] 2022-03-20 00:44:23 -07:00
Guy Harris
cf7bee146c CHANGES: remove from the main-only list a change now in 4.99.2. [skip ci] 2022-03-19 23:04:28 -07:00
Guy Harris
c74314dbf2 CREDITS: add author of a change backported to 4.99.2. [skip ci] 2022-03-19 23:02:41 -07:00
Guy Harris
2623f3f4f5 CHANGES: add another change backported to 4.99.2. [skip ci] 2022-03-19 23:02:14 -07:00
Guy Harris
d4a364f2cf CHANGES: add another change that's now in 4.99.2. [skip ci] 2022-03-19 22:47:24 -07:00
Guy Harris
6d3b0e4599 icmp: clean up the extension code and comments.
Remove remaining references to them as being MPLS-related;
draft-bonica-icmp-mpls-02 referred to them as "ICMP Extensions for
MultiProtocol Label Switching", but draft-bonica-internet-icmp-00
redefined it as a general extension mechanism, not MPLS-related, and
that draft eventually became RFC 4884.

draft-bonica-icmp-mpls-02 also defined class 2 objects as objects
containing the remaining packet information past the first 128 bytes;
that never became part of an RFC and class 2 was redefined as an
"Interface Information Object" in RFC 5837.

Give some of these details in comments, and move some
extension-related definitions among the rest of the extension stuff.
2022-03-19 22:17:43 -07:00
Guy Harris
0bf5c3360d CHANGES: add some main-only changes. [skip ci] 2022-03-19 22:10:45 -07:00
Guy Harris
64753a67f9 CHANGES: add some more changes now in 4.99.2. [skip ci] 2022-03-19 18:58:36 -07:00
Guy Harris
8c4941d130 CHANGES: move a change now in 4.99.2 to its section. [skip ci] 2022-03-19 17:35:11 -07:00
Guy Harris
a2629c969d CHANGES: add some more changes now in 4.99.2. [skip ci] 2022-03-19 17:25:36 -07:00
Guy Harris
275e6be516 CHANGES: move a change that's now in 4.99.2. [skip ci] 2022-03-19 16:51:26 -07:00
Guy Harris
e6db12b1a1 CREDITS: remove some no-longer-active contributors that got added back. [skip ci]
To quote a comment from a 2003 commit that removed them the first time:

        removed people who shouldn't be bugged since they aren't
        actively committing code now.
2022-03-19 16:23:02 -07:00
Guy Harris
423731bbda CREDITS: add some names found by scanning the Git logs. [skip ci]
Update Bill Fenner's email address in the "Past maintainers" list.
2022-03-19 16:16:45 -07:00
Guy Harris
605f51ba3a CHANGES: some more fixes backported to 4.99.2. [skip ci] 2022-03-19 14:30:08 -07:00
Guy Harris
a03e69cf19 CHANGES: add another change backported to 4.99.2. [skip ci] 2022-03-19 14:21:13 -07:00
Guy Harris
c5fedf8a5b CHANGES: another fix now in 4.99.2. [skip ci] 2022-03-19 14:18:55 -07:00
Guy Harris
1651815c5e CHANGES: add another now-backported fix. [skip ci] 2022-03-19 14:16:05 -07:00
Guy Harris
35c1b3c798 CHANGES: add a change recently backported to 4.99.2. [skip ci] 2022-03-19 14:05:18 -07:00
Denis Ovsienko
0bba1cdaf5 CI: Relax the illumos exemption rule. [skip appveyor]
As it turns out, the same warnings reproduce with other Clang versions
(at least 11) and other illumos distributions (at least OmniOS), so omit
Clang version in the pattern.
2022-03-11 15:07:08 +00:00
Francois-Xavier Le Bail
8630bd5e79 Rename two pcapng test files to .pcapng 2022-03-08 16:37:42 +01:00
Francois-Xavier Le Bail
7c4064c6d1 Fix two invalid tests
Fix these cppcheck warnings:
addrtoname.c:1288:11: warning: Checking if unsigned expression 'num'
is less than zero. [unsignedLessThanZero]
 if (num  <= 0) {
          ^
addrtoname.c:1308:11: warning: Checking if unsigned expression 'num'
is less than zero. [unsignedLessThanZero]
 if (num  <= 0) {
          ^
2022-03-08 10:30:35 +01:00
Francois-Xavier Le Bail
68f6ee780d PPP: Change the pointer to packet data
Thus it can be used for debugging.
2022-03-07 15:32:07 +01:00
Francois-Xavier Le Bail
68218acff7 RESP: Remove an unnecessary test
Moreover:
Remove an unneeded variable.
2022-03-06 10:33:40 +01:00
Guy Harris
82cfcd4391 Revert "Clean a bunch of fuzzed files not to fuzz the container."
This reverts commit a02c2faeec.

That zeroed out bits in the non-reserved portion of the field; the
reserved portion was already zero.
2022-03-04 18:03:41 -08:00
Guy Harris
a02c2faeec Clean a bunch of fuzzed files not to fuzz the container.
For some reason pcap fuzzers just *love* to fuzz the "link-layer type
plus other stuff" part of the pcap file header.  That can produce a file
that has non-zero values in reserved fields, which means it can get
rejected well before being handed to anything for dissection.

Clear out one of the reserved parts of that field, as we'll be changing
libpcap to check for non-zero values and reporting an error.
2022-03-04 16:04:46 -08:00
Francois-Xavier Le Bail
6a76f38bfa Add a const qualifier 2022-03-04 14:21:44 +01:00
Francois-Xavier Le Bail
1c49ac0b44 ASCII/hex: Rename a variable
s/oset/offset/

Moreover:
Fix indentation.
2022-03-04 10:50:27 +01:00
Francois-Xavier Le Bail
9fe73b290d RESP: Fix an invalid check
Fix this cppcheck warning:
print-resp.c:215:22: warning: Checking if unsigned expression 'length'
is less than zero. [unsignedLessThanZero]
    if(!bp || length <= 0)
                     ^
2022-03-02 21:49:17 +01:00
Francois-Xavier Le Bail
c43334b0d4 RX: Add a const qualifier 2022-03-02 21:13:53 +01:00
Francois-Xavier Le Bail
dc02d078e7 TCP: Fix an invalid check
Fix this cppcheck warning:
print-tcp.c:711:20: warning: Checking if unsigned expression 'length'
is less than zero. [unsignedLessThanZero]
        if (length <= 0)
                   ^
2022-03-02 17:47:18 +01:00
Francois-Xavier Le Bail
51a470b913 ESP: Add a const qualifier 2022-03-02 17:07:30 +01:00
Francois-Xavier Le Bail
9ff9f78db3 instrument functions: Reduce the scope of a variable 2022-03-02 14:55:27 +01:00
Francois-Xavier Le Bail
e9f9fbf2b9 Update config.{guess,sub}, timestamps 2022-01-09,2022-01-03
From repository git://git.savannah.gnu.org/config.git
2022-02-22 19:28:19 +01:00
Francois-Xavier Le Bail
fcd4628a6d RADIUS: Remove a no more used label 'trunc'
Fix the previous commit.
2022-02-20 13:01:12 +01:00
Francois-Xavier Le Bail
c4e4486020 RADIUS: Use GET_U_1() to replace a direct dereference
Remove some now unnecessary ND_TCHECK_*().
2022-02-20 11:44:25 +01:00
Francois-Xavier Le Bail
2800b89683 ISAKMP: Use GET_U_1() to replace a direct dereference
Moreover:
Remove an unnecessary cast and an & operator.
2022-02-19 10:40:35 +01:00