From owner-svn-src-all@freebsd.org Sat Jun 9 17:16:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31E361011F61; Sat, 9 Jun 2018 17:16:59 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 085D87DECE; Sat, 9 Jun 2018 12:26:15 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w59CQDGl018934; Sat, 9 Jun 2018 05:26:13 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w59CQDSb018933; Sat, 9 Jun 2018 05:26:13 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806091226.w59CQDSb018933@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334875 - head/sys/net In-Reply-To: <201806090957.w599vEK5085653@repo.freebsd.org> To: "Andrey V. Elsukov" Date: Sat, 9 Jun 2018 05:26:13 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:16:59 -0000 > Author: ae > Date: Sat Jun 9 09:57:14 2018 > New Revision: 334875 > URL: https://svnweb.freebsd.org/changeset/base/334875 > > Log: > Explicitly change the link state when we assingn an address. > > Since we are setting IFF_UP flag on SIOCSIFADDR, it is possible, that > after this link state information still not initialized properly. > This leads to problems with routing, since now interface has > IFCAP_LINKSTATE capability and a route is considered as working only > when interface's link state is in LINK_STATE_UP (see RT_LINK_IS_UP() > macro). I was going to say something when the ability to up and down the loopback interfaces was added as it perturbed me but I could not put my finger on places it may cause problems so remained silent on the matter. Now that I see this issue, having lo0 go DOWN can kill a network that is using exported from lo0 into a routing protocol routes that are used for management purposes. How does Cisco, Juniper, etc at handle this? Do any of them or all of them allow you to "down" loopback? > > Reported by: Marek Zarychta > MFC after: 3 days > > Modified: > head/sys/net/if_loop.c > > Modified: head/sys/net/if_loop.c > ============================================================================== > --- head/sys/net/if_loop.c Sat Jun 9 04:54:36 2018 (r334874) > +++ head/sys/net/if_loop.c Sat Jun 9 09:57:14 2018 (r334875) > @@ -380,6 +380,7 @@ loioctl(struct ifnet *ifp, u_long cmd, caddr_t data) > case SIOCSIFADDR: > ifp->if_flags |= IFF_UP; > ifp->if_drv_flags |= IFF_DRV_RUNNING; > + if_link_state_change(ifp, LINK_STATE_UP); > /* > * Everything else is done at a higher level. > */ > > -- Rod Grimes rgrimes@freebsd.org