From owner-freebsd-hackers@FreeBSD.ORG Sun May 23 16:06:39 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C005916A4CE for ; Sun, 23 May 2004 16:06:39 -0700 (PDT) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by mx1.FreeBSD.org (Postfix) with ESMTP id EF44643D41 for ; Sun, 23 May 2004 16:06:38 -0700 (PDT) (envelope-from arno@heho.snv.jussieu.fr) Received: from heho.snv.jussieu.fr (heho.snv.jussieu.fr [134.157.184.22]) i4NN6JKL082380 for ; Mon, 24 May 2004 01:06:19 +0200 (CEST) X-Ids: 165 Received: from heho.snv.jussieu.fr (localhost [127.0.0.1]) i4NN6IAp085731 for ; Mon, 24 May 2004 01:06:18 +0200 (MEST) Received: (from arno@localhost) by heho.snv.jussieu.fr (8.12.11/8.12.11/Submit) id i4NN6Ime085728; Mon, 24 May 2004 01:06:18 +0200 (MEST) (envelope-from arno) To: freebsd-hackers@freebsd.org From: "Arno J. Klaassen" Date: 24 May 2004 01:06:17 +0200 Message-ID: Lines: 31 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Miltered: at shiva.jussieu.fr with ID 40B12E6B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Antivirus: scanned by sophie at shiva.jussieu.fr Subject: early attaching tap0 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2004 23:06:39 -0000 --=-=-= Hello, ehmm, i hesitate writing to this list since I'm really not a hacker, but I have a problem I seemingly cannot resolve : I would like the "device tap" entry of my kernel-config to create and open an ethernet-device, rather than just initialising the necessary kernel structures. I made the following diff (needs "COPTFLAGS = -O -pipe -DTAP_INIT_ETHER" since I do not know how to implement correctly a kernel option ...) : --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=tap.patch Index: net/if_tap.c =================================================================== RCS file: /home/ncvs/src/sys/net/if_tap.c,v retrieving revision 1.42 diff -r1.42 if_tap.c 125a126,132 > #if defined (TAP_INIT_ETHER) > #include > static int tap_need_init = 1; > dev_t tap0dev; > void tapether(void); > #endif /* defined (TAP_INIT_ETHER) */ > 140c147 < int s; --- > intrmask_t s; 156a164,168 > #if defined (TAP_INIT_ETHER) > tap0dev = make_dev(&tap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, > "tap0"); > tapcreate (tap0dev); > #endif /* defined (TAP_INIT_ETHER) */ 264c276 < static void --- > void 315a328,336 > #if defined (TAP_INIT_ETHER) > if (tap_need_init == 1) { > ifp->if_type = IFT_ETHER; > ifp->if_baudrate = 1200; > tp->tap_flags |= TAP_OPEN; > tp->tap_pid = 0; /* curproc->p_pid; */ > tap_need_init = 0; > } > #endif 325a347 > 892a915 > --=-=-= A kernel with this patch boots OK single user, but when going multi-user it panics randomly (sorry Thomas for blaming atapicam, I thouht I doublechecked outcommenting COPTFLAGS before contacting you, I'm not sure I did everything well ...) I made similar changes to -stable and RELENG_5_2 which work OK (i.e. no panics, stable system), but against -current I am in the mist. If ever someone has a quick idea about what I am doing wrong, thanx a lot in advance. Regards, Arno --=-=-=--