From owner-freebsd-net@freebsd.org Fri Jun 22 16:38:19 2018 Return-Path: Delivered-To: freebsd-net@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 6ACA5102076E for ; Fri, 22 Jun 2018 16:38:19 +0000 (UTC) (envelope-from freebsd@dukhovni.org) Received: from mournblade.imrryr.org (mournblade.imrryr.org [108.5.242.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E059F769A1 for ; Fri, 22 Jun 2018 16:38:18 +0000 (UTC) (envelope-from freebsd@dukhovni.org) Received: by mournblade.imrryr.org (Postfix, from userid 1034) id 70F2B7A330A; Fri, 22 Jun 2018 16:38:12 +0000 (UTC) Date: Fri, 22 Jun 2018 16:38:12 +0000 From: Viktor Dukhovni To: freebsd-net@freebsd.org Subject: Re: [PATCH]: The 6to4 stf0 interface flapping in/out of tentative in FreeBSD 11 Message-ID: <20180622163812.GA17559@mournblade.imrryr.org> Reply-To: freebsd-net@freebsd.org References: <20171106042248.GL3322@mournblade.imrryr.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171106042248.GL3322@mournblade.imrryr.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2018 16:38:19 -0000 On Mon, Nov 06, 2017 at 04:22:48AM +0000, Viktor Dukhovni wrote: > Today, I looked closely at the kernel sources and found the issue. > Patch below. Interfaces found to not have IFF_DRV_RUNNING in > if_drv_flags by the periodic interface scan are marked tentative. > Since the "stf" driver did not set that flag, the "stf" interface > flaps. > > Index: sys/net/if_stf.c > =================================================================== > --- sys/net/if_stf.c (revision 325169) > +++ sys/net/if_stf.c (working copy) > @@ -722,6 +722,7 @@ > } > > ifp->if_flags |= IFF_UP; > + ifp->if_drv_flags |= IFF_DRV_RUNNING; > break; > > case SIOCADDMULTI: I just upgraded to 11.1-p10, forgetting I had patched my kernel, and the stf0 interface flapping was back, with IPv6 connectivity disappearing every other second or so (interface shows as "tentative" and outgoing connections fail with "can't assign requested address"). Appied the same patch and rebooted, and the problem is gone. Here's the patch again: Index: sys/net/if_stf.c --- sys/net/if_stf.c (revision 333375) +++ sys/net/if_stf.c (working copy) @@ -722,6 +722,7 @@ } ifp->if_flags |= IFF_UP; + ifp->if_drv_flags |= IFF_DRV_RUNNING; break; case SIOCADDMULTI: $ svn info Path: . Working Copy Root Path: /usr/src URL: https://svn0.us-west.freebsd.org/base/releng/11.1 Relative URL: ^/releng/11.1 Repository Root: https://svn0.us-west.freebsd.org/base Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f Revision: 333375 Node Kind: directory Schedule: normal Last Changed Author: gordon Last Changed Rev: 333375 Last Changed Date: 2018-05-08 13:18:24 -0400 (Tue, 08 May 2018) -- VIktor.