From f634c7420a9345987001c0e965c4d79057197f6f Mon Sep 17 00:00:00 2001 From: Thomas Fleischmann Date: Thu, 19 Feb 2015 02:46:48 -0800 Subject: mausezahn: Fix reading of hex payload file Using the option -F with mausezahn, to read input out of a hexfile, results in corrupt data transmitted (first byte will always be 0). Properly parse "payload="/p=" at the start of the file by the same method as used in layer3.c and layer4.c Closes #153 Reference: http://permalink.gmane.org/gmane.linux.network.netsniff-ng/600 Signed-off-by: Thomas Fleischmann Reported-by: Thomas De Schampheleire Signed-off-by: Tobias Klauser --- staging/layer1.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'staging') diff --git a/staging/layer1.c b/staging/layer1.c index a1ca417..bf00a52 100644 --- a/staging/layer1.c +++ b/staging/layer1.c @@ -58,7 +58,8 @@ int send_eth(void) j=0; char err_buf[LIBNET_ERRBUF_SIZE], - message[MAX_PAYLOAD_SIZE*3]; + message[MAX_PAYLOAD_SIZE*3], + argval[MAX_PAYLOAD_SIZE*2]; u_int8_t bytestring[MAX_PAYLOAD_SIZE]; libnet_ptag_t t; @@ -100,7 +101,10 @@ int send_eth(void) // Create a temporal, local bytestring: // for (i=0; i