android: fix the path of the tunnel node in the /dev tree
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 17 Jan 2013 09:01:21 +0000 (10:01 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 29 Jan 2013 12:50:02 +0000 (13:50 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
contrib/netsimpcap/src/network_tap.c
lib/bmf/src/NetworkInterfaces.c
src/kernel_tunnel.h

index 8e4075e..ed03682 100644 (file)
@@ -43,6 +43,7 @@
 #include "config.h"
 #include "debug.h"
 #include "network_tap.h"
+#include "kernel_tunnel.h"
 
 char macBroadcast[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
 
@@ -138,7 +139,7 @@ closeTap(int fd)
 int
 createTap(char *name, MacAddress * mac)
 {
-  static const char deviceName[] = "/dev/net/tun";
+  static const char * deviceName = OS_TUNNEL_PATH;
   int etfd;
   struct ifreq ifreq;
 
index 61eceda..27251c9 100644 (file)
@@ -64,6 +64,7 @@
 #include "tc_set.h" /* olsr_lookup_tc_entry(), olsr_lookup_tc_edge() */
 #include "net_olsr.h" /* ipequal */
 #include "lq_plugin.h"
+#include "kernel_tunnel.h"
 
 /* Plugin includes */
 #include "Packet.h" /* IFHWADDRLEN */
@@ -1201,7 +1202,7 @@ static int CreateEncapsulateSocket(const char* ifName)
  * ------------------------------------------------------------------------- */
 static int CreateLocalEtherTunTap(void)
 {
-  static const char deviceName[] = "/dev/net/tun";
+  static const char * deviceName = OS_TUNNEL_PATH;
   struct ifreq ifreq;
   int etfd;
   int ioctlSkfd;
index 691191f..f644f9c 100644 (file)
 #define TUNNEL_ENDPOINT_IF "tunl0"
 #define TUNNEL_ENDPOINT_IF6 "ip6tnl0"
 
+#ifdef __ANDROID__
+  #define OS_TUNNEL_PATH "/dev/tun"
+#else
+  #define OS_TUNNEL_PATH "/dev/net/tun"
+#endif
+
 struct olsr_iptunnel_entry {
   struct avl_node node;
   union olsr_ip_addr target;