Build system: Fix check for <linux/if_tun.h> and remove our copy
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 28 Dec 2014 16:02:13 +0000 (16:02 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 28 Dec 2014 16:09:40 +0000 (16:09 +0000)
 * Check for <linux/if_tun.h>, not <linux/if.h>, since the former is
   what we include.

 * Remove our embedded copy of linux/if_tun.h.  We have no need of
   this any more as all recent Linux platforms will provide this as
   part of the system.  This is good because linux/if_tun.h is
   GPLv2-only and secnet as a whole has to be GPLv3+ when built
   because it contains and depends on a few GPLv3+ things.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
config.h.in
configure
configure.in
debian/changelog
linux/if_tun.h [deleted file]
tun.c

index a8b73b9..13034ba 100644 (file)
@@ -35,8 +35,8 @@
 /* Define to 1 if you have the `socket' library (-lsocket). */
 #undef HAVE_LIBSOCKET
 
-/* Define to 1 if you have the <linux/if.h> header file. */
-#undef HAVE_LINUX_IF_H
+/* Define to 1 if you have the <linux/if_tun.h> header file. */
+#undef HAVE_LINUX_IF_TUN_H
 
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
index cf4e581..a025190 100755 (executable)
--- a/configure
+++ b/configure
@@ -3806,16 +3806,16 @@ fi
 
 done
 
-for ac_header in linux/if.h
+for ac_header in linux/if_tun.h
 do :
-  ac_fn_c_check_header_compile "$LINENO" "linux/if.h" "ac_cv_header_linux_if_h" "#if HAVE_SYS_SOCKET_H
+  ac_fn_c_check_header_compile "$LINENO" "linux/if_tun.h" "ac_cv_header_linux_if_tun_h" "#if HAVE_SYS_SOCKET_H
 # include <sys/socket.h>
 #endif
 
 "
-if test "x$ac_cv_header_linux_if_h" = xyes; then :
+if test "x$ac_cv_header_linux_if_tun_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LINUX_IF_H 1
+#define HAVE_LINUX_IF_TUN_H 1
 _ACEOF
 
 fi
index 0c0c545..9250f75 100644 (file)
@@ -27,7 +27,7 @@ AC_STDC_HEADERS
 AC_CHECK_HEADERS([stdint.h inttypes.h])
 AC_CHECK_HEADERS([net/if.h net/route.h])
 AC_CHECK_HEADERS([sys/socket.h])
-AC_CHECK_HEADERS([linux/if.h], [], [], 
+AC_CHECK_HEADERS([linux/if_tun.h], [], [], 
 [#if HAVE_SYS_SOCKET_H
 # include <sys/socket.h>
 #endif
index 51859bc..a832496 100644 (file)
@@ -7,6 +7,7 @@ secnet (0.4.0~beta2~) unstable; urgency=low
   * Makefile: support DESTDIR.
   * debian/rules: set DESTDIR (not prefix).
   * Do not install ipaddrset.py and secnet.8 executable.
+  * Fix check for <linux/if_tun.h>.
 
  --
 
diff --git a/linux/if_tun.h b/linux/if_tun.h
deleted file mode 100644 (file)
index ec4e9db..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- *  Universal TUN/TAP device driver.
- *  Copyright (C) 1999-2000 Maxim Krasnyansky <max_mk@yahoo.com>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- *  GNU General Public License for more details.
- *
- *  $Id: if_tun.h,v 1.1 2001/11/21 14:54:03 steve Exp $
- */
-
-#ifndef __IF_TUN_H
-#define __IF_TUN_H
-
-/* Uncomment to enable debugging */
-/* #define TUN_DEBUG 1 */
-
-#ifdef __KERNEL__
-
-#ifdef TUN_DEBUG
-#define DBG  if(tun->debug)printk
-#define DBG1 if(debug==2)printk
-#else
-#define DBG( a... )
-#define DBG1( a... )
-#endif
-
-struct tun_struct {
-       char                    *name;
-       unsigned long           flags;
-       int                     attached;
-       uid_t                   owner;
-
-       wait_queue_head_t       read_wait;
-       struct sk_buff_head     readq;
-
-       struct net_device       dev;
-       struct net_device_stats stats;
-
-       struct fasync_struct    *fasync;
-
-#ifdef TUN_DEBUG       
-       int debug;
-#endif  
-};
-
-#ifndef MIN
-#define MIN(a,b) ( (a)<(b) ? (a):(b) ) 
-#endif
-
-#endif /* __KERNEL__ */
-
-/* Read queue size */
-#define TUN_READQ_SIZE 10
-
-/* TUN device flags */
-#define TUN_TUN_DEV    0x0001  
-#define TUN_TAP_DEV    0x0002
-#define TUN_TYPE_MASK   0x000f
-
-#define TUN_FASYNC     0x0010
-#define TUN_NOCHECKSUM 0x0020
-#define TUN_NO_PI      0x0040
-#define TUN_ONE_QUEUE  0x0080
-#define TUN_PERSIST    0x0100  
-
-/* Ioctl defines */
-#define TUNSETNOCSUM  _IOW('T', 200, int) 
-#define TUNSETDEBUG   _IOW('T', 201, int) 
-#define TUNSETIFF     _IOW('T', 202, int) 
-#define TUNSETPERSIST _IOW('T', 203, int) 
-#define TUNSETOWNER   _IOW('T', 204, int)
-
-/* TUNSETIFF ifr flags */
-#define IFF_TUN                0x0001
-#define IFF_TAP                0x0002
-#define IFF_NO_PI      0x1000
-#define IFF_ONE_QUEUE  0x2000
-
-struct tun_pi {
-       unsigned short flags;
-       unsigned short proto;
-};
-#define TUN_PKT_STRIP  0x0001
-
-#endif /* __IF_TUN_H */
diff --git a/tun.c b/tun.c
index d5e0e9e..9d32945 100644 (file)
--- a/tun.c
+++ b/tun.c
@@ -12,7 +12,7 @@
 
 #ifdef HAVE_NET_IF_H
 #include <net/if.h>
-#ifdef HAVE_LINUX_IF_H
+#ifdef HAVE_LINUX_IF_TUN_H
 #include <linux/if_tun.h>
 #define LINUX_TUN_SUPPORTED
 #endif