From owner-freebsd-bugs@freebsd.org Sat Oct 31 07:08:26 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E9B8442E6A for ; Sat, 31 Oct 2020 07:08:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4CNVdP6grxz45R2 for ; Sat, 31 Oct 2020 07:08:25 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id E536B442E69; Sat, 31 Oct 2020 07:08:25 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4FE4442E67 for ; Sat, 31 Oct 2020 07:08:25 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CNVdP5qt4z45Fy for ; Sat, 31 Oct 2020 07:08:25 +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 ABB2B23AD9 for ; Sat, 31 Oct 2020 07:08:25 +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 09V78Pd9064617 for ; Sat, 31 Oct 2020 07:08:25 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 09V78Pl3064616 for bugs@FreeBSD.org; Sat, 31 Oct 2020 07:08:25 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 250749] /etc/network.subr: Mitigate absence of LINK_UP notification when VIRTIO_NET_F_STATUS is not negotiated Date: Sat, 31 Oct 2020 07:08:25 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: samy.mahmoudi@gmail.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 attachments.created 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 MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Oct 2020 07:08:26 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D250749 Bug ID: 250749 Summary: /etc/network.subr: Mitigate absence of LINK_UP notification when VIRTIO_NET_F_STATUS is not negotiated Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: samy.mahmoudi@gmail.com Created attachment 219229 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D219229&action= =3Dedit Patch file Hi, On some virtual machines (e.g. on VirtualBox, on the cloud platform Vultr, etc.), restarting a vtnet interface configured with DHCP fails to restart dhclient. Because the driver 'if_vtnet' follows the driver requirements of the VIRTIO specification [1], LINK_UP is notified at most once (most probably during t= he boot process) when VIRTIO_NET_F_STATUS is not negotiated. As a result, dhcl= ient can not be restarted via devd. For a similar reason, it might be possible that LINK_UP is not emitted at t= he interface restart even in a variant scenario where VIRTIO_NET_F_STATUS is negotiated (I do not have access to a bhyve-capable computer right now so I= am unable to test). If SYNCDHCP is used to configure the interface, dhclient is restarted via netif/network.subr. The attached patch makes dhclient start from two different ways (devd and netif/network.subr) when the interface is configured with DHCP. In that reg= ard, DHCP would behave exactly like SYNCDHCP and inherit the same race that currently happens with SYNCDHCP when an interface is restarted [2]. =E2=80=A2 Mitigate the absence of LINK_UP notification to restart dhclient,= at least when VIRTIO_NET_F_STATUS is not negotiated =E2=80=A2 Remove a comment note (success of wpaif does imply interface conf= iguration and wpa_supplicant does bring up the interface) =E2=80=A2 Remove a trailing whitespace [1] https://docs.oasis-open.org/virtio/virtio/v1.1/csprd01/virtio-v1.1-csprd01.= html (5.1.4.2 Driver Requirements, second paragraph) [2] This race does not happen during the boot process because devd has not = yet been started when netif runs). It is reproductible on a computer by configu= ring an interface with SYNCDHCP and executing, e.g., 'service netif restart wlan= 0' a dozen of times, or even more easily with a lagg interface by executing, e.g= ., 'service netif restart wlan0 lagg0'. It has no functional impact, but it ma= kes one seriously wonder why 'dhclient is already running' whereas one just restarted one's interface... --=20 You are receiving this mail because: You are the assignee for the bug.=