From owner-freebsd-hackers Sat Dec 16 13:46:17 2000 From owner-freebsd-hackers@FreeBSD.ORG Sat Dec 16 13:46:15 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from elvis.mu.org (elvis.mu.org [207.154.226.10]) by hub.freebsd.org (Postfix) with ESMTP id 7449037B402 for ; Sat, 16 Dec 2000 13:46:15 -0800 (PST) Received: by elvis.mu.org (Postfix, from userid 1098) id D93F22B230; Sat, 16 Dec 2000 15:46:04 -0600 (CST) Date: Sat, 16 Dec 2000 15:46:04 -0600 From: Bill Fumerola To: Dan Phoenix Cc: Poul-Henning Kamp , freebsd-hackers@FreeBSD.ORG Subject: Re: Tun driver? Message-ID: <20001216154604.A72273@elvis.mu.org> References: <4581.976715688@critter> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from dphoenix@bravenet.com on Thu, Dec 14, 2000 at 08:00:18AM -0800 X-Operating-System: FreeBSD 4.2-FEARSOME-20001103 i386 Sender: billf@elvis.mu.org Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Dec 14, 2000 at 08:00:18AM -0800, Dan "Mahir" Phoenix wrote: > what you mean device side? > you mean server side? He meant exactly what he said: [billf.yahoo-root 16:26:00] < /dev # ifconfig tun0 ifconfig: interface tun0 does not exist [billf.yahoo-root 16:26:09] < /dev # dd if=/dev/tun0 of=/dev/null count=0 0+0 records in 0+0 records out 0 bytes transferred in 0.000014 secs (0 bytes/sec) [billf.yahoo-root 16:26:18] < /dev # ifconfig tun0 tun0: flags=8010 mtu 1500 [billf.yahoo-root 16:26:20] < /dev # Some program needs to open() the device for it to register. The following snippet of code (around line 155 of sys/net/if_tun.c) is relevant: tp = dev->si_drv1; if (!tp) { tuncreate(dev); tp = dev->si_drv1; } .. and tuncreate() sets up the device and if_attach()s the driver, which makes it appear in the list ifconfig works off of. -- Bill Fumerola - security yahoo / Yahoo! inc. - fumerola@yahoo-inc.com / billf@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message