From nobody Wed Jan 17 22:44:49 2024 X-Original-To: net@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 4TFgtV4v41z56wnB for ; Wed, 17 Jan 2024 22:44:50 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TFgtV0mQFz48Tk for ; Wed, 17 Jan 2024 22:44:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705531490; 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: in-reply-to:in-reply-to:references:references; bh=PKkqi6z2OCVRQORCO/IbknaHakTcW+ZLN6m/Q79k/4c=; b=awCuDik16VOUe70mubMCsrbUpNVD3p8PY2DK9hup831auN/eFiJ2+f3J3/M0whHDjy0Ize SYQjpgEliKBUyt0rQrnQH83tqnSI0iukQkQYBdwCkp473wMMpj+GIdCA1qLfmvY3OObkZd 4Ja0mnmgQyRI678pBq+jAm7XlRtqBnUTKEBN8/FbUzkS0z3nN6Sfsln1yXEESo2FJBe1IU 4L/IPAXy3FUM6BLLQJR3o05QSsmG5u7mygFmWXAEpQWjLPQ/DD1ArzYEzrVWZMqfnW7O4w rdSM5/Tny1o/pW5PQtXTHq2JNI070CrIy47UXKK2nnf+rL/R1nY0jnY3Flf/tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705531490; a=rsa-sha256; cv=none; b=ZzJjLmENuIHSKoa0qyCpnpbkQUQ35dHD6+ZSjkM1cWY40DuSwXqHUTPIWbb2top3GqNrXG v9DT5q7anyxjr6rr7Wc0gJ7jKQkGnv2rSV6S1IzqujO+Az/SMgb2f0Ud+MPrOhZ00NP50e hf6i6hVEyNrtAkGWSwsV6uzKc0w+n6DTahtJOHMuS7U+Z3xeEIytPgElb75p56NV4uOl/7 9vdTxpzImNJ3EUz5e9yO6eJZ7HUOQ07RxkU4pFF8avrJ3tmmGpLt+Z8BlZo6GjrHLWnM4+ eRQ064paOsUgg9okp+4A6U7XzahAQmgX3zxeTqWxyIVzE1ITK55vQXWrBE9Anw== 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 4TFgtT56YqzhmK for ; Wed, 17 Jan 2024 22:44:49 +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 40HMinkr002226 for ; Wed, 17 Jan 2024 22:44:49 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 40HMin5s002225 for net@FreeBSD.org; Wed, 17 Jan 2024 22:44:49 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: net@FreeBSD.org Subject: [Bug 276363] if_wg: Fix bug in calculate_padding() for the 'p_mtu = 0' case Date: Wed, 17 Jan 2024 22:44:49 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: kevans@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D276363 Kyle Evans changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kevans@freebsd.org --- Comment #2 from Kyle Evans --- (In reply to Aaron LI from comment #1) I would perhaps reorganize it slightly at that point: static inline unsigned int=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20 calculate_padding(struct wg_packet *pkt)=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20 {=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20 unsigned int padded_size, last_unit =3D pkt->p_mbuf->m_pkthdr.len;= =20=20=20=20=20=20=20=20 padded_size =3D (last_unit + (WG_PKT_PADDING - 1)) & ~(WG_PKT_PADDI= NG - 1); if (__predict_true(pkt->p_mtu !=3D 0)) {=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 if (__predict_false(last_unit > pkt->p_mtu))=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 last_unit %=3D pkt->p_mtu;=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 if (pkt->p_mtu < padded_size)=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 padded_size =3D pkt->p_mtu;=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 }=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 return (padded_size - last_unit);=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20 } --=20 You are receiving this mail because: You are the assignee for the bug.=