Bug in ip_tos.c use of libnet_build_ethernet()
[email protected] Fri, 22 Oct 2004 14:25:12 -0400
| Newsgroups | gmane.comp.security.libnet |
|---|---|
| Message-ID | <[email protected]> |
As I struggled with libnet_build_ethernet(), I found that it's used incorrectly in sample/ip_tos.c. That file includes:
char *hwdst = "22:22:22:22:22:22" ...;
...
eth_ptag = libnet_build_ethernet(
hwdst,
...);
but the first two arguments to libnet_build_ethernet() aren't strings, they are arrays of 6 bytes. The above code leads to a packet that has a destination MAC address of 32:32:3a:32:32:3a because '2' is 0x32 and ':' is 0x3a and libnet_build_ethernet() looks at the first 6 bytes ( "22:22:") and treats them as uint8_t, not characters.
Is there somewhere I can log this error besides this mailing list?