From nobody Fri Sep 03 18:17:07 2021 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D6EB717A3B9B for ; Fri, 3 Sep 2021 18:17:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H1QxH5f9Fz4YVH for ; Fri, 3 Sep 2021 18:17:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 984E4F93 for ; Fri, 3 Sep 2021 18:17:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 183IH7IC059462 for ; Fri, 3 Sep 2021 18:17:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 183IH7v5059461 for bugs@FreeBSD.org; Fri, 3 Sep 2021 18:17:07 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 258257] /etc/rc.d/netif handles renamed VLAN interfaces incorrectly Date: Fri, 03 Sep 2021 18:17:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: conf X-Bugzilla-Version: 13.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: mkern@alconconstruction.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258257 Bug ID: 258257 Summary: /etc/rc.d/netif handles renamed VLAN interfaces incorrectly Product: Base System Version: 13.0-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: conf Assignee: bugs@FreeBSD.org Reporter: mkern@alconconstruction.com For the case I'm describing, I have a network interface re0 (driver doesn't matter), and I need to bring up the main interface, as well as VLANs 3 and = 10. The interface for vlan10 needs to be renamed, from re0.10 to re0.l. Here are the relevant lines from rc.conf, for how I understand to configure this: ifconfig_re0=3D"DHCP" vlans_re0=3D"3 10" ifconfig_re0_3=3D"inet 192.168.3.8/24" ifconfig_re0_10_name=3D"re0.l" ifconfig_re0_l=3D"inet 192.168.10.8/24" However, this does not work. The first time through netif, re0 and re0.3 are brought up properly, and re0.10 with no configuration is created. Then, when devd starts, it discovers a not-yet-setup re0.10, and eventually calls neti= f to start re0.10. This time, netif finds the line to rename re0.10, and does so= - and then fails to find any more information for configuring re0.10, and so leaves me with re0.l with no configuration. At this point, running "service netif restart re0.l" (or even without explicitly naming the interface) will set up re0.l properly. However the intention is for the interface to come up automatically. For now, I've discovered a functioning workaround. The above config, modifi= ed: ifconfig_re0=3D"DHCP" vlans_re0=3D"3 10" ifconfig_re0_3=3D"inet 192.168.3.8/24" ifconfig_re0_10=3D"inet 192.168.10.8/24 name re0.l" ifconfig_re0_l=3D"inet 192.168.10.8/24" In this case, the first boot through ends up mostly working properly - this time, childif_create feeds that full line into ifconfig, which sets the add= ress and renames it all at once. The next step, which calls "ifconfig re0.10 up" fails, but the interface ends up in the up state anyway. The last line need= s to be present to ensure that restarting netif works - since on any time through after the first, re0.l is discovered and explicitly brought up by name. Thi= s is because we're still in a strange state, since "service netif stop" leaves t= he re0.l interface existing. It seems to me that the correct solution looks like this: childif_create sh= ould go through all the steps that netif_start does, rather than skipping to ifn_start (in particular, it needs to call the ifnet_rename function). In addition, netif_start (and childif_create as described above) should determ= ine whether ifnet_rename actually renamed what we're working on, and switch to = that new name for the remainder of the function. Unfortunately, I must leave the exact details of the implementation up to someone who understands these scr= ipts and how they relate to each other better than I do. For a slightly more detailed run through of what's happening, and what I ex= pect to happen, see https://forums.FreeBSD.org/threads/renamed-vlan-interface-needs-netif-resta= rt-to-start.81904/post-530039 --=20 You are receiving this mail because: You are the assignee for the bug.=