From nobody Wed Dec 8 08:34:48 2021 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 E33A918DBDEB; Wed, 8 Dec 2021 08:34:48 +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 4J89T44lz4z4cHW; Wed, 8 Dec 2021 08:34:48 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 836A67A6A; Wed, 8 Dec 2021 08:34:48 +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 1B88YmZ7097226; Wed, 8 Dec 2021 08:34:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B88YmLt097225; Wed, 8 Dec 2021 08:34:48 GMT (envelope-from git) Date: Wed, 8 Dec 2021 08:34:48 GMT Message-Id: <202112080834.1B88YmLt097225@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: b3d4891af03d - main - enetc: Fix VID/mcast address hash calculation 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3d4891af03d1d4fe497b537519ed4995630aa08 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638952488; 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=Wq1i0TEHPzfG7kjnQPWC29tzUumftO01RND1VKy7T20=; b=NZ0AYbrl0bc4bVG+usYE8Mr7ep7yWv1OoRjAAA8o62XADpWPcSXZZWta7YSLpHsXqR/rPF fkK/qQyU4Xx3UsM7Tmsp1V5jisljwhXl12D/HEYwh5H7UqB6u7yJe7CeeAC4lZF/ux+CDj mHmgmwH/hgTn2cyKQBuVmfM2eLZj6UZvWsoJV/kNhvXZyCS9qOQPo4TMB3Jym3MOdyDWc0 FjI1TXMukZD8kRyVJw8ILEuRUSt72yA6+iJ5AJ1ry5VBkw9i/8R3EmcXxg5UfKkSOqoUGc I+cziAhzKDHHm39Ib3I9anVyL6d3sCL7Nlpy+E4iUbIU7vl5BoqJE+uGbHW7rg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638952488; a=rsa-sha256; cv=none; b=ySEZ/z0ZEk9vpHq4CpsSAU4f7sVqNaNAJ7H/L63f1xBky4ZJEHNtRqBOClU8BppficdMmf 5pzl3gesXZE6s1jjuweYcCxzpVq0BD/ZP7U/SdpFUyo060VN4xEvOjWXX0R8PiPx/NoWV7 PJ5+vAqCA6iIFLml6pjNyLRYPtnD0jye3i+rGQMXaY//Iq4ThnAaU5ZPawZY57Z77yglwl 1MZZKsCdWKUc2yu8rvHrOUS0aeE4kTrfEoiUARC7Fb+yGSIif9KoU1grXPdB9E2F5KLF8e fylMJ3eH/6J/j1QylWOBHJubuJwVxPNQzW/be58IPuhCpe+VVObWmQMOMR1gbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=b3d4891af03d1d4fe497b537519ed4995630aa08 commit b3d4891af03d1d4fe497b537519ed4995630aa08 Author: Kornel Duleba AuthorDate: 2021-11-30 08:23:29 +0000 Commit: Wojciech Macek CommitDate: 2021-12-08 08:32:51 +0000 enetc: Fix VID/mcast address hash calculation The hash is calculated by XOR-ing together bits of the VID. Prepend a statement with "!!" to make sure that we're get bit 0 on both sides of the equation. Obtained from: Semihalf Sponsored by: Alstom Group --- sys/dev/enetc/if_enetc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/enetc/if_enetc.c b/sys/dev/enetc/if_enetc.c index abdb527760f6..e05e551ff48f 100644 --- a/sys/dev/enetc/if_enetc.c +++ b/sys/dev/enetc/if_enetc.c @@ -811,7 +811,7 @@ enetc_hash_mac(void *arg, struct sockaddr_dl *sdl, u_int cnt) for (i = 0; i < 6; i++) { bit = 0; for (j = 0; j < 8; j++) - bit ^= address & BIT(i + j*6); + bit ^= !!(address & BIT(i + j*6)); hash |= bit << i; } @@ -852,7 +852,7 @@ enetc_hash_vid(uint16_t vid) for (i = 0;i < 6;i++) { bit = vid & BIT(i); - bit ^= vid & BIT(i + 6); + bit ^= !!(vid & BIT(i + 6)); hash |= bit << i; }