mirror of
https://code.semirocket.science/wrapsix
synced 2024-12-04 19:51:02 +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"
|
#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;
|
||||||
@ -63,7 +61,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
int sniff_sock;
|
int sniff_sock;
|
||||||
int length;
|
int length;
|
||||||
char buffer[PACKET_SIZE];
|
char buffer[PACKET_BUFFER];
|
||||||
|
|
||||||
log_info(PACKAGE_STRING " is starting");
|
log_info(PACKAGE_STRING " is starting");
|
||||||
|
|
||||||
@ -128,7 +126,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, PACKET_SIZE, 0)) == -1) {
|
if ((length = recv(sniff_sock, buffer, PACKET_BUFFER, 0)) == -1) {
|
||||||
log_error("Unable to retrieve data from socket");
|
log_error("Unable to retrieve data from socket");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,8 @@
|
|||||||
#include "ipv6.h"
|
#include "ipv6.h"
|
||||||
|
|
||||||
/* +++ CONFIGURE +++ */
|
/* +++ CONFIGURE +++ */
|
||||||
#define MTU 1280
|
#define MTU 1280 /* MTU on IPv6 side */
|
||||||
|
#define PACKET_BUFFER 1514 /* buffer for any packet */
|
||||||
/* --- CONFIGURE --- */
|
/* --- CONFIGURE --- */
|
||||||
|
|
||||||
extern struct ifreq interface;
|
extern struct ifreq interface;
|
||||||
|
Loading…
Reference in New Issue
Block a user