Skip to content
Snippets Groups Projects
Commit 9c9a8242 authored by Michael Tüxen's avatar Michael Tüxen
Browse files

Oh well, Linux doesn't tell you the correct version number via

linux/version.h. At least not on Rasbian. So take out the last
change and just try to set TUN_F_UFO and ignore if it worked
or not.
This allows to run packetdrill on a Raspberry Pi running Rasbian.
parent 960d14d7
No related branches found
No related tags found
No related merge requests found
......@@ -44,9 +44,6 @@
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
#include <net/if_tun.h>
#endif /* defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) */
#if defined(linux)
#include <linux/version.h>
#endif
#include "ip.h"
#include "ipv6.h"
......@@ -206,11 +203,11 @@ static void set_device_offload_flags(struct local_netdev *netdev)
#ifdef linux
u32 offload = TUN_F_CSUM | TUN_F_TSO4 | TUN_F_TSO6 | TUN_F_TSO_ECN;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0))
offload |= TUN_F_UFO;
#endif
if (ioctl(netdev->tun_fd, TUNSETOFFLOAD, offload) != 0)
die_perror("TUNSETOFFLOAD");
/* Linux 3.18 doesn't support TUN_F_UFO. So try and ignore... */
offload = TUN_F_UFO;
ioctl(netdev->tun_fd, TUNSETOFFLOAD, offload);
#endif
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment