1
0
mirror of https://code.semirocket.science/wrapsix synced 2024-12-03 19:21:01 +02:00

Separated MTU and size of packet buffer

This commit is contained in:
Michal Zima 2012-07-14 09:47:29 +02:00
parent faa0ecc060
commit b9c6d5c46a
2 changed files with 4 additions and 5 deletions

View File

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

View File

@ -23,7 +23,8 @@
#include "ipv6.h"
/* +++ CONFIGURE +++ */
#define MTU 1280
#define MTU 1280 /* MTU on IPv6 side */
#define PACKET_BUFFER 1514 /* buffer for any packet */
/* --- CONFIGURE --- */
extern struct ifreq interface;