[netfilter-cvslog] r3450 - trunk/nfsim/tools
gandalf at netfilter.org
gandalf at netfilter.org
Sun Dec 19 03:31:49 CET 2004
Author: gandalf at netfilter.org
Date: 2004-12-19 03:31:48 +0100 (Sun, 19 Dec 2004)
New Revision: 3450
Modified:
trunk/nfsim/tools/gen_ip.c
trunk/nfsim/tools/ifconfig.c
Log:
Populate both source and destination macadresses to avoid valgrind warnings.
Use ETH_HLEN as the length of the header. This makes it more correct to what you see from ethernet interfaces.
Modified: trunk/nfsim/tools/gen_ip.c
===================================================================
--- trunk/nfsim/tools/gen_ip.c 2004-12-18 23:53:15 UTC (rev 3449)
+++ trunk/nfsim/tools/gen_ip.c 2004-12-19 02:31:48 UTC (rev 3450)
@@ -704,7 +704,9 @@
}
if (argc > 5 && strncmp(argv[1], "MAC=", 4) == 0) {
- if (!parse_mac(argv[1]+4, packet->ehdr.h_source)) {
+ /* populate both h_dest and h_source */
+ if (!parse_mac(argv[1]+4, packet->ehdr.h_dest)
+ || !parse_mac(argv[1]+4, packet->ehdr.h_source)) {
nfsim_log(LOG_UI, "Invalid mac address.");
return false;
}
Modified: trunk/nfsim/tools/ifconfig.c
===================================================================
--- trunk/nfsim/tools/ifconfig.c 2004-12-18 23:53:15 UTC (rev 3449)
+++ trunk/nfsim/tools/ifconfig.c 2004-12-19 02:31:48 UTC (rev 3450)
@@ -127,7 +127,7 @@
strncpy(dev->name, name, IFNAMSIZ);
dev->ifindex = ifindex_counter++;
dev->ip_ptr = indev;
- dev->hard_header_len = ETH_ALEN;
+ dev->hard_header_len = ETH_HLEN;
memset(&dev->stats, 0, sizeof(dev->stats));
indev->ifa_list = talloc(indev, struct in_ifaddr);
More information about the netfilter-cvslog
mailing list