From nobody Tue May 02 18:46:49 2023 X-Original-To: dev-commits-src-all@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 4Q9pvt1wvMz49HTm; Tue, 2 May 2023 18:46:50 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9pvt1FkCz3yYj; Tue, 2 May 2023 18:46:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683053210; 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=ZNcBB8r6halXyRF4oVBC8qQMQgB8JOtc7eluHfnNt/Q=; b=P7WLpxqEpy2t2zIKYgUfb4Z/BhfczzmNnIWPUvf1+YTzPBcysOa/oG1o9cGk2nHTgVwMgS BMSXMcqv5zg+xkoUfnD2MP/ww6R3vu7ZQ1+USBzDznaYsPzP10z/KXGWPPo0xGp77c1iCO tn7YkV7WjjzkAY89QIQ6PESPYC4GMsTosJkZcYiTmgkrfW0sF1OR+2SILCbVEa64Bdfa9c yrIaz4o4D/W45z/8+VpCfJ2t8Kdv2vQQNDbuv+IR54fMKpEiJMow2SoRoZUu8TsJUqmQgf yQpA+jOYT9dFk/TDQK5PJnsWto6yPDnHA3HDUO5PhkTEF18iAPZJ7Rg9wgtO/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683053210; 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=ZNcBB8r6halXyRF4oVBC8qQMQgB8JOtc7eluHfnNt/Q=; b=UPBgUfitH/ytnOAh81ekqXAY7H8UH0Xy3vAYAYcKDCL0MPuR4O7G9vCF1/U6Kqe2bKdVWD 4YyWzxB+3Ta+u3Al87kOiKc4Gu4jG/IVb5z+TQ0kVnWKukT63IDF1jhn/t45z11DHwgFnt vezlalDfgYQ+6uXe+3hC0lnnqmmRULG0s6rVV3FUhvUgAcAOKDBo7ahWSP/TI58X5QzwYg tAbr8PKg5JqHqQD5ybyMvPt5GFeeOwzRrijxtIW8CMs57N4jmyn0oDH7+Z5Nm3T8kucjNY 4AwZqWFR/T2PWQilZV1WOylWyk8kHEejB2MXbobhC5ZTSflYsz7vTUkIWGN99g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683053210; a=rsa-sha256; cv=none; b=MV8OSMnbxE7up9RGNp5owsM2pyHkMfNh7b+JMiGxXWn9rAUxJ1IV1GaHXtLezgvw5V+aZQ mwCHCv7I9MOv4qrJJD8H8Gp9z6mrcUwUFCVqieiEXmCFR3QaG0zAAdDNSJaJS3yqLCl7ut AzezK9BtZHCdX161MmzXDsPcULz3STpbwH97fQZW3MZlTEZkwDnlx0oiEpTnUu9MM7TtVd jd99hnTTazhBvZIFZo5TbBEi+LKT0k7Eo24Q7esSK/DTR2SsPwBHP5oKqalYjqdMqpnvcI QW94zAbZVklutykP5VI1MbohzrJc46O+Ir7lA+tsrEPfoT5k4y7t++q92wzSnQ== 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 4Q9pvt0HzXzytb; Tue, 2 May 2023 18:46:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 342IkntK009174; Tue, 2 May 2023 18:46:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 342IknjH009173; Tue, 2 May 2023 18:46:49 GMT (envelope-from git) Date: Tue, 2 May 2023 18:46:49 GMT Message-Id: <202305021846.342IknjH009173@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: f766d1d5a7c6 - main - IfAPI: Add if_maddr_empty() to check for any maddrs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f766d1d5a7c65d001c443e3fd21694645d58b8b2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=f766d1d5a7c65d001c443e3fd21694645d58b8b2 commit f766d1d5a7c65d001c443e3fd21694645d58b8b2 Author: Justin Hibbits AuthorDate: 2023-04-10 18:20:00 +0000 Commit: Justin Hibbits CommitDate: 2023-05-02 18:34:47 +0000 IfAPI: Add if_maddr_empty() to check for any maddrs if_llmaddr_count() only counts link-level multicast addresses. hv_netvsc(4) needs to know if there are any multicast addresses. Since hv_netvsc(4) is the only instance where this would be used, make it a simple boolean. If others need a if_maddr_count(), that can be added in the future. Reviewed by: melifaro Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D39493 --- sys/net/if.c | 7 +++++++ sys/net/if_var.h | 1 + 2 files changed, 8 insertions(+) diff --git a/sys/net/if.c b/sys/net/if.c index b53a361c2ba3..af9758a39324 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -4685,6 +4685,13 @@ if_llmaddr_count(if_t ifp) return (count); } +bool +if_maddr_empty(if_t ifp) +{ + + return (CK_STAILQ_EMPTY(&ifp->if_multiaddrs)); +} + u_int if_foreach_llmaddr(if_t ifp, iflladdr_cb_t cb, void *cb_arg) { diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 98d65be2ef81..f87472509863 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -657,6 +657,7 @@ u_int if_foreach_lladdr(if_t, iflladdr_cb_t, void *); u_int if_foreach_llmaddr(if_t, iflladdr_cb_t, void *); u_int if_lladdr_count(if_t); u_int if_llmaddr_count(if_t); +bool if_maddr_empty(if_t); int if_getamcount(const if_t ifp); struct ifaddr * if_getifaddr(const if_t ifp);