When printing New Address events, the extra_str buffer is overrun,
resulting in weird stuff happening.
> RTNL: Error (0x02) len 20 > 5.252075
Flags: 0 (0x000)
Sequence number: 189 (0x000000bd)
Port ID: 2116
ACK: 0
==4080== Invalid read of size 1
==4080== at 0x4E8000E: vfprintf (in /lib64/libc-2.20.so)
==4080== by 0x4EA8A24: vsnprintf (in /lib64/libc-2.20.so)
==4080== by 0x4E86011: snprintf (in /lib64/libc-2.20.so)
==4080== by 0x403B64: print_packet (nlmon.c:238)
==4080== by 0x40C8FD: print_nlmsghdr (nlmon.c:3197)
==4080== by 0x40CD9E: print_rtnl_msg (nlmon.c:3266)
==4080== by 0x40CE4F: nlmon_print_rtnl (nlmon.c:3298)
==4080== by 0x40D1CD: nlmon_receive (nlmon.c:3390)
Currently it supports Microsoft specific data which has type
and vesion value 1.
e.g.
Vendor specific: len 22
Microsoft (00:50:f2)
WPA:
Type: 1
Version: 1(0001)
Group Data Cipher Suite: len 4
TKIP (00:50:f2) suite 02
Pairwise Cipher Suite: len 4
TKIP (00:50:f2) suite 02
AKM Suite: len 4
IEEE 802.1X/PMKSA; RSNA/PMKSA caching (00:50:f2) suite 01
Support arbitrarily long bitfields by providing field and mask values
as arrays with their length measured in bytes. Some of the IE fields
easily reach 80 bits or more, thus easily overrunning any integer sizes
used by the OS architecture.
If flags was 0, then an uninitialized buffer was printed. Changed
this so that if flags == 0, then just the value is printed.
If flags != 0, then print flags values to a buffer that is big
enough to hold all the sub-strings.
The buffer that is allocated for the filename is too short and
as sprintf() was used it overflowed the buffer easily when longer
interface name was used.
Additional universal message flags are defined which are applied
only for GET requests (NLM_F_ROOT, NLM_F_ATOMIC, NLM_F_MATCH,
NLM_F_DUMP) and flags which are related to NEW requests
(NLM_F_REPLACE, NLM_F_EXCL, NLM_F_CREATE, NLM_F_APPEND).
Print the SSID IE. If the SSID is not UTF-8 compliant, replace the non-
compliant byte with the UTF-8 substitution character. If the SSID is
hidden, its length and/or all characters are zero; print nothing in
this case.
Memory allocated l_timeout struct from l_timeout_create not being
freed.
==4184== HEAP SUMMARY:
==4184== in use at exit: 32 bytes in 1 blocks
==4184== total heap usage: 50 allocs, 49 frees, 39,902 bytes allocated
==4184==
==4184== 32 bytes in 1 blocks are definitely lost in loss record 1 of 1
==4184== at 0x4C2ABA0: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4184== by 0x40706D: l_malloc (util.c:62)
==4184== by 0x408D9A: l_timeout_create (timeout.c:117)
==4184== by 0x40896A: signal_callback (signal.c:82)
==4184== by 0x408692: l_main_run (main.c:346)
==4184== by 0x402474: main (main.c:797)
==4184==
==4184== LEAK SUMMARY:
==4184== definitely lost: 32 bytes in 1 blocks
==4184== indirectly lost: 0 bytes in 0 blocks
==4184== possibly lost: 0 bytes in 0 blocks
==4184== still reachable: 0 bytes in 0 blocks
==4184== suppressed: 0 bytes in 0 blocks