Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Make tun interfaces perform auto-creation. This mea...



details:   https://anonhg.NetBSD.org/src/rev/dd8e95bd364d
branches:  trunk
changeset: 534570:dd8e95bd364d
user:      atatat <atatat%NetBSD.org@localhost>
date:      Mon Jul 29 16:53:30 2002 +0000

description:
Make tun interfaces perform auto-creation.  This means that if a
program opens /dev/tun# and tun# has not been SIOCIFCREATE'd already,
it will be SIOCIFCREATE'd automatically.  FreeBSD's tun interfaces
behave in a somewhat similar fashion.

diffstat:

 sys/net/if_tun.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 282c89017f09 -r dd8e95bd364d sys/net/if_tun.c
--- a/sys/net/if_tun.c  Mon Jul 29 16:25:02 2002 +0000
+++ b/sys/net/if_tun.c  Mon Jul 29 16:53:30 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tun.c,v 1.51 2002/03/13 06:43:18 itojun Exp $       */
+/*     $NetBSD: if_tun.c,v 1.52 2002/07/29 16:53:30 atatat Exp $       */
 
 /*
  * Copyright (c) 1988, Julian Onions <jpo%cs.nott.ac.uk@localhost>
@@ -15,7 +15,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.51 2002/03/13 06:43:18 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.52 2002/07/29 16:53:30 atatat Exp $");
 
 #include "tun.h"
 
@@ -230,6 +230,11 @@
 
        tp = tun_find_unit(dev);
 
+       if (!tp) {
+               (void)tun_clone_create(&tun_cloner, minor(dev));
+               tp = tun_find_unit(dev);
+       }
+
        if (!tp)
                return (ENXIO);
 



Home | Main Index | Thread Index | Old Index