Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Separated MTU and size of packet buffer

  • Loading branch information...
commit b9c6d5c46ae57b32551e1383d8b33222e1f8a6a9 1 parent faa0ecc
@xHire authored
Showing with 4 additions and 5 deletions.
  1. +2 −4 src/wrapper.c
  2. +2 −1  src/wrapper.h
View
6 src/wrapper.c
@@ -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
3  src/wrapper.h
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.