mirror of
https://code.semirocket.science/wrapsix
synced 2024-11-24 14:49:48 +02:00
Extended packet buffer
This commit is contained in:
parent
34025797b1
commit
5b50001a5c
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user