diff --git a/if_helper.c b/if_helper.c index a65c6ff..004b70d 100644 --- a/if_helper.c +++ b/if_helper.c @@ -24,6 +24,16 @@ int if_down(char *name) { return ret; } +int if_mtu(char *name, int mtu) { + char buf[128]; + snprintf(buf, sizeof(buf), "ifconfig %s mtu %d", name, mtu); + int ret = system(buf); + if (ret != 0) { + printf("Could set MTU for interface %s\n", name); + } + return ret; +} + int if_enable_ibss(char *name) { char buf[128]; snprintf(buf, sizeof(buf), "iw %s set type ibss", name); diff --git a/if_helper.h b/if_helper.h index 1188146..9d414dc 100644 --- a/if_helper.h +++ b/if_helper.h @@ -3,6 +3,7 @@ int if_up(char *name); int if_down(char *name); +int if_mtu(char *name, int mtu); int if_promisc(char *name); int if_enable_ibss(char *name); int if_join_ibss(char *name, char *essid, int frequency); \ No newline at end of file diff --git a/main.c b/main.c index f3e413a..04b9d03 100644 --- a/main.c +++ b/main.c @@ -40,7 +40,7 @@ int domainSocket; #define PROTOCOL_IDENTIFIER 0x9f77 // Max payload length -#define PAYLOAD_LENGTH 4096 +#define PAYLOAD_LENGTH 1500 // ESSID and frequency for network #define ESSID "WiPacket" @@ -358,6 +358,7 @@ void configureInterface() { if_down(if_name); if_enable_ibss(if_name); if_up(if_name); + if_mtu(if_name, PAYLOAD_LENGTH); if_join_ibss(if_name, essid, frequency); if_promisc(if_name); }