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:
parent
faa0ecc060
commit
b9c6d5c46a
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user