From nobody Mon Dec 16 14:50:06 2024 X-Original-To: dev-commits-src-main@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 4YBjXb60Vgz5hWy9; Mon, 16 Dec 2024 14:50:07 +0000 (UTC) (envelope-from git@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBjXb1J5gz4qZ5; Mon, 16 Dec 2024 14:50:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734360607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7x4fpkWWXD+HH+PPN0l4E++nf0uZufNt9EaE6XoQja0=; b=cXJTgWyii/3H/cbrD1eztqOa0VAEU/CZkaUqHZvlCqMQ8m9nHJsdmgBkG136aWy9LxxNgk S3uiIOs4U+e1GMpSAetOBoQWuOzCR79Bs49ZBKuNOGghbNl/qU/9xEzzU0hFOkbDlSed7t LgVAiVa7XyYg+pb46kK7jEOKPj7QlsnWqj+Kk8mXzvmPfOJSRWNFGPOSoEg1GJvLQtxR/7 LzVvV+wvbx9yU0dbg6R3f92jMWz/9wgytNQlIgsopHi1ZdwQquPfkq/UDBh7TdxlB3gcXO rn3gcDaUHhmnYjAgzjVLVuoEgqXRd/9vUedFRbsu+NvaGo/O1NL1+D4gWta7Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734360607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7x4fpkWWXD+HH+PPN0l4E++nf0uZufNt9EaE6XoQja0=; b=glbifFih1oMUID3giiux3kCdCOTnYC4orGtZmGg9aJ5ga6otF0PMHpSmc1XAkypbXks7Ka fYM+QN5Og2TWRSsplI3nbJ3hyWtFRfTjlGQqaUeKq29feBF6EZUBUtxTrvmS4iniAF4p2z QLzmZ0elEq7/1ThHMGpUKaKXo3Gta8OKDnRiKmmkHGGgot+cjK5SuH4WK7eWe6KyFDmjQ2 NVlgdrdLlojQr/z9kjajDV3CSE2NUjnQkk9yN2xF0zFyQoriOF4Qk+jaOdRwJMhUkUYe8y Zayj7BwYQX7W4BT4SFHghQpkm2Fbsp1hfOIKbdACLJQR8k/lqreVrcVRg2JtBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734360607; a=rsa-sha256; cv=none; b=ofK6/iAmdghxXSSnjP0k9U9sGdIjEeO4tpvv7a/kritpToJbnjFOEAYDaQJcJnaB8y0HTl ISsPuE7UtJhQuH1pl3PIN6pgd+hPLhhFkdl4VjXt1BZFLOBw20DbYbLJ1GFIJEfz4vT46y 3aw9L8efiH46/SqnWBl5wh9aN29V6148yVqhSM5eBCl+FP1CfBk1xXQqF+VX0JsuSNTZKL TWJeo2hwAzB04XLza2DoB+LyYuhD4tujbAc4MXCjPzCjk1Uu5d5UZu9wWFjlsjh4ugaghV rWhVVTZXfe25UuEQNE/A42ml//xA/6zVIgdEM87uUp1c/8/jTZfOxfSKONkZNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4YBjXb0VlGzx0R; Mon, 16 Dec 2024 14:50:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGEo6AJ058977; Mon, 16 Dec 2024 14:50:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGEo63X058972; Mon, 16 Dec 2024 14:50:06 GMT (envelope-from git) Date: Mon, 16 Dec 2024 14:50:06 GMT Message-Id: <202412161450.4BGEo63X058972@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 2ef97d8b7564 - main - xen/netfront: use iflladdr_event to send ARPs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ef97d8b7564c5d3e62248b49f9ebbbae5dc02f3 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=2ef97d8b7564c5d3e62248b49f9ebbbae5dc02f3 commit 2ef97d8b7564c5d3e62248b49f9ebbbae5dc02f3 Author: Gleb Smirnoff AuthorDate: 2024-12-16 14:48:50 +0000 Commit: Gleb Smirnoff CommitDate: 2024-12-16 14:49:29 +0000 xen/netfront: use iflladdr_event to send ARPs Avoids usage of arp_ifinit() and if_foreach_addr_type(). The former isn't encouraged to be used in drivers and the latter is about to change to not expose struct ifaddr. Reviewed by: royger, ehem_freebsd_m5p.com Differential Revision: https://reviews.freebsd.org/D48053 --- sys/dev/xen/netfront/netfront.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c index e13fb8765bae..3bc3679eb0db 100644 --- a/sys/dev/xen/netfront/netfront.c +++ b/sys/dev/xen/netfront/netfront.c @@ -1029,27 +1029,6 @@ out: return (error); } -#ifdef INET -static u_int -netfront_addr_cb(void *arg, struct ifaddr *a, u_int count) -{ - arp_ifinit((if_t)arg, a); - return (1); -} -/** - * If this interface has an ipv4 address, send an arp for it. This - * helps to get the network going again after migrating hosts. - */ -static void -netfront_send_fake_arp(device_t dev, struct netfront_info *info) -{ - if_t ifp; - - ifp = info->xn_ifp; - if_foreach_addr_type(ifp, AF_INET, netfront_addr_cb, ifp); -} -#endif - /** * Callback received when the backend's state changes. */ @@ -1090,7 +1069,12 @@ netfront_backend_changed(device_t dev, XenbusState newstate) break; case XenbusStateConnected: #ifdef INET - netfront_send_fake_arp(dev, sc); + /* + * If this interface has an ipv4 address, send an arp for it. + * This helps to get the network going again after migrating + * hosts. + */ + EVENTHANDLER_INVOKE(iflladdr_event, sc->xn_ifp); #endif break; }