From nobody Mon Dec 09 16:19:26 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 4Y6Rrv0k5Zz5gTsb; Mon, 09 Dec 2024 16:19:27 +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 4Y6Rrv0Cw0z4SmS; Mon, 9 Dec 2024 16:19:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733761167; 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=FxjzKmPFtNf5vw0boeFdVWdusFGuh8ZmcuXoM3j8Teg=; b=qcY/UfqpJdF8Hp6PcFtbI+gHNW/GaBdgMBtB0lM5FPU217axBx3rXhm5rdOPvGZjeDjavw wR/JD8vg894odYaV+bgQZ1N+0UngLn7OgnXjkJ/ZRfabLJV3jrJzbcW4WvxR1LP43Pzxyo 2QSLMKj1tVMcFZ9HQqAk7iMu8O2CpBtkVcWYSVj8eFJOp6FCVguTVA5XBdeiRfhrvLcOFG n/4kWdj3ssiF/rDAv5niWdYyx6jzJpHzWteHmKYQw5Wr483ADQzDciuPXL5NUW+gNRnLOA MLbq4MTNfI7xcwtlaNeTxJi7+q92PRjMyVaAaCbpVbmyjXpmBCoi44GxAmo+Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733761167; 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=FxjzKmPFtNf5vw0boeFdVWdusFGuh8ZmcuXoM3j8Teg=; b=hZuq0o6mhi+kCRR31JVmrOMgzfffC/kWy0cgMSZNGUlSR6um9JZ9fdfrDIdPwqPhzMgU3V rOxQmeLhiYaNh6LUqkGvLmHcNcqKfez7cQIIYI9IVjFkIH4X8tSdlKUHgMotTCxt/4E3UF OJ1zhrIfuSGkXXUTgcHGKC6hsW65+CXweS9pTSBKBjyUrRtz79hqFvtSi7ORlv2NE1W2a4 yXj90SpCF4V0VgN/Q+twdPBgnN04JS506gD0rCm2oQTu5F3nk65Vv7QzbTVt07DlfVjYo0 mkjsLSHakJcBgvMGCoPLrDqNzv4piUD1PB6FIPFkpiOg/5dFCmdFqy2QUVl51Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733761167; a=rsa-sha256; cv=none; b=YPvraBIiL16REuyGLehN9xeSrqaiwXPXGUU0iahY72QfxteOh+RwaROldr1B2yLbN4MLu9 lU/Eh+MNIjms+ejA3I7WUnEuAqUpAfZaB0aWpiEFtA0qhm/GgQ0cjU0OZl6aXqpfXSgSx4 wL6i5Rz0WBPgKHj8zOxIRXeKz5c1jkmeUaZmY+wrzJbV33ozgjhex7Yv7vaQNwTM1DRpXp APSUv2urevOJ+krO8YAwA+VIZSeFkThH2MIm5Kfhfuy6NTbuw1F/uhiddjJUabXEFxoAr3 d3GErELRKldRIthGG6U5jk7KuoXVTA2V+lXppsAW7kuKe+L2HKDWTmQ2p09bCw== 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 4Y6Rrt6p4CzlRv; Mon, 9 Dec 2024 16:19:26 +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 4B9GJQ7G019820; Mon, 9 Dec 2024 16:19:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B9GJQud019817; Mon, 9 Dec 2024 16:19:26 GMT (envelope-from git) Date: Mon, 9 Dec 2024 16:19:26 GMT Message-Id: <202412091619.4B9GJQud019817@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: d3f035f8d96a - main - ifnet: make sa_dl_equal() a static function 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: d3f035f8d96ae0e1c49ab725aa9d86be63d293d6 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=d3f035f8d96ae0e1c49ab725aa9d86be63d293d6 commit d3f035f8d96ae0e1c49ab725aa9d86be63d293d6 Author: Gleb Smirnoff AuthorDate: 2024-12-09 16:18:56 +0000 Commit: Gleb Smirnoff CommitDate: 2024-12-09 16:18:56 +0000 ifnet: make sa_dl_equal() a static function No functional change. Also clears last use of CLLADDR() macro. --- sys/net/if.c | 15 +++++++++------ sys/net/if_dl.h | 1 - 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 8dc212ae4ac7..25cad0222c06 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1799,13 +1799,16 @@ ifa_free(struct ifaddr *ifa) * structs used to represent other address families, it is necessary * to perform a different comparison. */ +static bool +sa_dl_equal(const struct sockaddr *a, const struct sockaddr *b) +{ + const struct sockaddr_dl *sdl1 = (const struct sockaddr_dl *)a; + const struct sockaddr_dl *sdl2 = (const struct sockaddr_dl *)b; -#define sa_dl_equal(a1, a2) \ - ((((const struct sockaddr_dl *)(a1))->sdl_len == \ - ((const struct sockaddr_dl *)(a2))->sdl_len) && \ - (bcmp(CLLADDR((const struct sockaddr_dl *)(a1)), \ - CLLADDR((const struct sockaddr_dl *)(a2)), \ - ((const struct sockaddr_dl *)(a1))->sdl_alen) == 0)) + return (sdl1->sdl_len == sdl2->sdl_len && + bcmp(sdl1->sdl_data + sdl1->sdl_nlen, + sdl2->sdl_data + sdl2->sdl_nlen, sdl1->sdl_alen) == 0); +} /* * Locate an interface based on a complete address. diff --git a/sys/net/if_dl.h b/sys/net/if_dl.h index e19f4a84a7c1..77663c2a20d7 100644 --- a/sys/net/if_dl.h +++ b/sys/net/if_dl.h @@ -66,7 +66,6 @@ struct sockaddr_dl { }; #define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen)) -#define CLLADDR(s) ((c_caddr_t)((s)->sdl_data + (s)->sdl_nlen)) #define LLINDEX(s) ((s)->sdl_index) struct ifnet;