From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 8 20:00:11 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 7E9BD16A4CE for ; Sun, 8 Aug 2004 20:00:11 +0000 (GMT) Received: from smtp2.fuse.net (mail-out2.fuse.net [216.68.8.175]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE03D43D2D for ; Sun, 8 Aug 2004 20:00:10 +0000 (GMT) (envelope-from cokane@cokane.org) Received: from gx4.fuse.net ([216.196.253.14]) by smtp2.fuse.net (InterMail vM.6.01.03.03 201-2131-111-105-20040624) with ESMTP id <20040808200009.WJLR969.smtp2.fuse.net@gx4.fuse.net> for ; Sun, 8 Aug 2004 16:00:09 -0400 Received: from [192.168.1.33] (really [216.196.253.14]) by gx4.fuse.net (InterMail vG.1.00.00.00 201-2136-104-20040331) with ESMTP id <20040808200009.JUHH9892.gx4.fuse.net@[192.168.1.33]>; Sun, 8 Aug 2004 16:00:09 -0400 From: Coleman Kane To: Maksim Yevmenkin In-Reply-To: <41140139.5080803@savvis.net> References: <346a8022040806145018a5e18@mail.gmail.com> <41140139.5080803@savvis.net> Content-Type: text/plain Message-Id: <1091995205.13151.7.camel@schizophreniac> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Sun, 08 Aug 2004 16:00:05 -0400 Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Mon, 09 Aug 2004 11:59:56 +0000 cc: hackers@freebsd.org Subject: Re: Network interface RUNNING and UP flags 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, 08 Aug 2004 20:00:11 -0000 That patch seems to have fixed it. It seemed strange that setting an inet address to the interface set it running, however setting the inet6 does not do this. It is possible this behavior affacts other interface types as well? On Fri, 2004-08-06 at 18:07, Maksim Yevmenkin wrote: > > 2) Is there a way to set this interface flag without assigning an IPv4 > > address (or any address for that matter) first? > > > > Mainly for number two, I would like to be able to run interfaces > > bridged together without having to also give all of them addresses. > > please try the attached (untested!) patch. it should set iff_running > flag on the interface as soon as the control device is opened. > > max > > ______________________________________________________________________ > --- if_tap.c.orig Fri Aug 6 15:02:06 2004 > +++ if_tap.c Fri Aug 6 15:04:14 2004 > @@ -336,15 +336,15 @@ > tapopen(dev, flag, mode, td) > struct cdev *dev; > int flag; > int mode; > struct thread *td; > { > struct tap_softc *tp = NULL; > - int error; > + int error, s; > > if ((error = suser(td)) != 0) > return (error); > > if ((dev2unit(dev) & CLONE_UNITMASK) > TAPMAXUNIT) > return (ENXIO); > > @@ -365,14 +365,19 @@ > return (EBUSY); > } > > bcopy(tp->arpcom.ac_enaddr, tp->ether_addr, sizeof(tp->ether_addr)); > tp->tap_pid = td->td_proc->p_pid; > tp->tap_flags |= TAP_OPEN; > mtx_unlock(&tp->tap_mtx); > + > + s = splimp(); > + tp->tap_if.if_flags |= IFF_RUNNING; > + tp->tap_if.if_flags &= ~IFF_OACTIVE; > + splx(s); > > TAPDEBUG("%s is open. minor = %#x\n", > tp->tap_if.if_xname, minor(dev)); > > return (0); > } /* tapopen */ >