chiark / gitweb /
tun: Drop support for Linux 2.2.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 1 Jul 2011 22:57:15 +0000 (23:57 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 1 Jul 2011 22:57:15 +0000 (23:57 +0100)
tun.c attempted to guess at runtime what kind of tun interface to use
by looking at uname.  Specifically, for Linux it would do
  TUN_FLAVOUR_BSD if u.release starts 2.2
  TUN_FLAVOUR_LINUX if u.release starts 2.4
and require the user to specify, otherwise.

Linux 2.6 and all later versions use TUN_FLAVOUR_LINUX.  The guessing
code is pretty nasty and Linux 2.2 is very very obsolete, so drop it.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tun.c

diff --git a/tun.c b/tun.c
index 5f9aa98d1051c5ae4d43ba32e6aa1768fa356447..7d1053a1915bfc3239ff9a07a686ef1fc99353f1 100644 (file)
--- a/tun.c
+++ b/tun.c
@@ -479,10 +479,7 @@ static list_t *tun_create(closure_t *self, struct cloc loc, dict_t *context,
            fatal_perror("tun_create: uname");
        }
        if (strcmp(u.sysname,"Linux")==0) {
-           if (u.release[0]=='2' && u.release[1]=='.' && u.release[3]=='.') {
-               if (u.release[2]=='2') st->tun_flavour=TUN_FLAVOUR_BSD;
-               else if (u.release[2]=='4') st->tun_flavour=TUN_FLAVOUR_LINUX;
-           }
+           st->tun_flavour=TUN_FLAVOUR_LINUX;
        } else if (strcmp(u.sysname,"SunOS")==0) {
            st->tun_flavour=TUN_FLAVOUR_STREAMS;
        } else if (strcmp(u.sysname,"FreeBSD")==0