Check to make sure we don't go past the length value in the header.
Note that the string in an Identity message is optional (so we just
don't bother printing it if it's zero-length), but the string in a
notification message isn't (so report an error if it's zero-length).
In some cases, EAP fragmentation/reassembly is done at a layer above
EAP, e.g. when EAP messages are contained within a RADIUS message and
are broken up into multiple TLVs in the message. In those cases, the
length handed to eap_print() will be different from the length in the
first fragment's header, and the remaining fragments won't *have* a
header, so the "length" will be garbage and thus unlikely to be equal to
the length handed to us.
The errors were like:
print-eap.c:179:25: runtime error: unsigned integer overflow:
2 - 5 cannot be represented in type 'unsigned int'
print-eap.c:181:50: runtime error: unsigned integer overflow:
2 - 5 cannot be represented in type 'unsigned int'
print-eap.c:186:25: runtime error: unsigned integer overflow:
2 - 5 cannot be represented in type 'unsigned int'
print-eap.c:188:50: runtime error: unsigned integer overflow:
2 - 5 cannot be represented in type 'unsigned int'
While cross-compile, ./configure --host=xxx will output:
"checking whether printf(3) supports the z length modifier...
configure: error: in `/${path_to_tcpdump}/tcpdump':"
That is casued by AC_RUN_IFELSE, as describe in
"https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Runtime.html"
, if AC_RUN_IFELSE do not have cross-compile option, configure prints an error message and exits.
Signed-off-by: Mingrui Ren jiladahe1997@gmail.com
This should address two AppVeyor/Visual Studio 2019/x64 warnings:
print-lwres.c(197,23): warning C4267: 'function': conversion from
'size_t' to 'u_int', possible loss of data
print-lwres.c(201,14): warning C4267: 'return': conversion from
'size_t' to 'unsigned int', possible loss of data
The 4 MSBs of the VID is stored in the lower nibble of the tag's third
byte.
Previously the priority bits where folded into the VID space, e.g. a
packet with VID=1 and priority 6 was printed as having a VID of
1537 (0x601).
Add DSA test PCAPs with packets containing a high VID and non-zero
FPri values to make sure we catch any future regressions.
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
The newly added pcap file contains a Mesh Beacon frame, a Wildcard Probe
Request and a Mesh Probe Response. The test case checks if the "Mesh ID"
field is properly parsed by the IEEE 802.11 printer.
SunOS openindiana 5.11 illumos-755ccbcfa2 i86pc i386 i86pc
gcc (OpenIndiana 10.3.0-oi-0) 10.3.0
As it turns out, in OpenIndiana 2021.04 ND_UNREACHABLE is one of the
neighbour discovery states in <net/if.h>:
In file included from ./extract.h:40,
from ./addrtoname.h:22,
from ./addrtoname.c:112:
./diag-control.h:181: warning: "ND_UNREACHABLE" redefined
In file included from ./addrtoname.c:87:
/usr/include/net/if.h:307: note: this is the location of the previous
definition
In file included from ./extract.h:40,
from ./addrtoname.h:22,
from ./print-sll.c:36:
./diag-control.h:181: warning: "ND_UNREACHABLE" redefined
In file included from ./print-sll.c:29:
/usr/include/net/if.h:307: note: this is the location of the previous
definition
(There doesn't appear to be an obvious way to force a rebuild, and a
change to libpcap doesn't force a rebuild of programs such as tcpdump
for which the CI build includes a build with the tip of the main branch
of libpcap.)
compiler-tests.h already checks whether __has_attribute and, if not,
defines it as a macro that always returns 0 (so that we use the "what
version of the compiler is this?" fallback checks for a given
attribute). We include compiler-tests.h before we define
__has_attribute ourselves, so we don't need to do it ourselves.
Add comments and indentation.
Handle XL C a bit more like the other compilers. Make the first test be
"is this someting that's not XL C", as is the case for other compilers;
that test is done as "are both __xlC__ and __ibmxl__ undefined". If
either of them are defined, use __ibmxl_version__ if __ibmxl__ is
defined, and use __xlC__ otherwise.
SunOS solaris11-amd64 5.11 11.4.0.15.0 i86pc i386 i86pc
clang version 6.0.0 (tags/RELEASE_600/final)
Every .c file that included netdissect-stdinc.h generated a warning:
In file included from ./netdissect-stdinc.h:42:
./ftmacros.h:48:11: warning: '__EXTENSIONS__' macro redefined
[-Wmacro-redefined]
<built-in>:345:9: note: previous definition is here
We only need a C compiler, and if either
1) the C and C++ compilers don't match (e.g., a defaults-to-64-bit GCC
and a defaults-to-32-bit Oracle Studio C++)
or
2) you set CFLAGS in the environment to force a 64-bit build but don't
also set CXXFLAGS
CMake will get confused and think it's doing a 32-bit build even though
we'll be doing a 64-bit build, and all sorts of weirdness will occur.
Just say "C" in the project() command.
There are two versions of pcap-config supplied on Solaris (or, at least,
on 64-bit Solaris) - a version that has the right --libs output to find
the 32-bit libraries and a version that has the right --libs output to
find the 64-bit libraries.
Try to figure out whether we're doing a 32-bit or 64-bit build (based on
the pointer size) and, for 64-bit builds, run the 64-bit version of
pcap-config.