From 5b50001a5c40394ab738120caea4dcade40a870b Mon Sep 17 00:00:00 2001 From: Michal Zima Date: Wed, 4 Jul 2012 13:52:11 +0200 Subject: [PATCH] Extended packet buffer --- src/wrapper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wrapper.c b/src/wrapper.c index 2ae2e5a..69afe44 100644 --- a/src/wrapper.c +++ b/src/wrapper.c @@ -43,6 +43,8 @@ #define IPV4_ADDR "192.168.0.111" /* --- CONFIGURATION --- */ +#define PACKET_SIZE MTU + sizeof(struct s_ethernet) + struct ifreq interface; struct s_mac_addr mac; @@ -61,7 +63,7 @@ int main(int argc, char **argv) int sniff_sock; int length; - char buffer[MTU]; + char buffer[PACKET_SIZE]; log_info(PACKAGE_STRING " is starting"); @@ -126,7 +128,7 @@ int main(int argc, char **argv) /* sniff! :c) */ for (;;) { addr_size = sizeof(addr); - if ((length = recv(sniff_sock, buffer, MTU, 0)) == -1) { + if ((length = recv(sniff_sock, buffer, PACKET_SIZE, 0)) == -1) { log_error("Unable to retrieve data from socket"); return 1; }