1
0
mirror of https://code.semirocket.science/wrapsix synced 2024-11-27 16:41:00 +02:00

Extended packet buffer

This commit is contained in:
Michal Zima 2012-07-04 13:52:11 +02:00
parent 34025797b1
commit 5b50001a5c

View File

@ -43,6 +43,8 @@
#define IPV4_ADDR "192.168.0.111" #define IPV4_ADDR "192.168.0.111"
/* --- CONFIGURATION --- */ /* --- CONFIGURATION --- */
#define PACKET_SIZE MTU + sizeof(struct s_ethernet)
struct ifreq interface; struct ifreq interface;
struct s_mac_addr mac; struct s_mac_addr mac;
@ -61,7 +63,7 @@ int main(int argc, char **argv)
int sniff_sock; int sniff_sock;
int length; int length;
char buffer[MTU]; char buffer[PACKET_SIZE];
log_info(PACKAGE_STRING " is starting"); log_info(PACKAGE_STRING " is starting");
@ -126,7 +128,7 @@ int main(int argc, char **argv)
/* sniff! :c) */ /* sniff! :c) */
for (;;) { for (;;) {
addr_size = sizeof(addr); 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"); log_error("Unable to retrieve data from socket");
return 1; return 1;
} }