From nobody Tue Jan 16 23:15:18 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 4TF4c70qqJz58Fk3; Tue, 16 Jan 2024 23:15:19 +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 4TF4c70Hnpz4Ng9; Tue, 16 Jan 2024 23:15:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705446919; 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=z+jkasPw99iZ9rO5RheOKFwqbvCm/EZotaaZp3NDR0U=; b=kUi232w9uVufl/h20mL6BwZiyZsak170BuE1K4xG4aMOsA3l+wKLqXbZsUsEq1Pn1nJAYM dBIxkr6DtglsiwQ/mp4bq6hklUeeSBDGmkH8CUET0V9Kjv5We7T0cwvn1zJY9tlYhNSNWx 0eIrzGYMG1fN09mzoAuh4A8GP6N3WfxpB1lBViWGs9I2MQZzn5V4czMkr2+L/L/ZAuY+I5 sqZ7ZSudmGppGKT4Wa8sngGPlkbFd0q9F5ICB8MYoxePcbFJKc+LVYGjEuWqWvZeqPQjWP Rwowzv7Vc9QLg7mme5IxfRkkXP+cCARJSH8QWQGl85JYhbMO5JxFNvXM6QYbMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705446919; 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=z+jkasPw99iZ9rO5RheOKFwqbvCm/EZotaaZp3NDR0U=; b=l+YebRcqowxh2tLT3rAIotT3rU2y1gYcLnVEA8yucaN0hoRiKcW2b5x6v0yngJE3bNU7Cd TPdgDN66m5tRpo+7tV4Q7g0aRyBMIQd436cZkgLt+AIZ8PbVSDNRQI52uMw8o8XdINttmI BSnkzofmL9YtTz8Fb/Lc/nDC7W4WPbtUT2AaNWPdGAkBOq9t8oQdYopKDit+JYWH0691jy O4ROVBdUHrKnAOSyqN5rcZCyrpJliOAhebhCW6WoH5vMmyvoKvm3U9SR9TVrUdR5Kx7usr dNKT+96kmPcHBhTiqo8EpKelYyFylKoHGt5di1nji66HxLFw7mzKBjrHnpimxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705446919; a=rsa-sha256; cv=none; b=xWKFRE6m6objXpDaJJ3qd65uhr5sXO/Jh7TrY/oUdmlLiTsmXKp2hStdb6/Ov0f/6EG1kx law7STLFGql5qPixMkRqBvzK07RcTsHcjTlRypn4zo80RnKH4Ms6tOsYeh25HkK8wPaiB+ qc+qgoovId9FYHAHHhj1xiqmLqfoVY6/3rBMikT9dpwMkEhqVWxPc0GMuTW4z9xq2DZe4J 0eN2BRj9Ai8z3w9G0b7QnJklWGXSRsQ5nNmBC0d5FO/j7lZ834wNpO+cXZ5oq/kQeYCJXJ jYQmM327Vn1OzT0bLXxDyPWU6P1qXoMZiC8ST5TTuBdW5G9pevN7NAhhCuOrVA== 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 4TF4c66W0Dz10fJ; Tue, 16 Jan 2024 23:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GNFI8p030444; Tue, 16 Jan 2024 23:15:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GNFIq4030441; Tue, 16 Jan 2024 23:15:18 GMT (envelope-from git) Date: Tue, 16 Jan 2024 23:15:18 GMT Message-Id: <202401162315.40GNFIq4030441@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Allan Jude Subject: git: dc02374f5445 - main - Fix KASSERT in 80044c78 causing build failures 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: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc02374f54455e354495870c24f86bb2966a7960 Auto-Submitted: auto-generated The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=dc02374f54455e354495870c24f86bb2966a7960 commit dc02374f54455e354495870c24f86bb2966a7960 Author: Allan Jude AuthorDate: 2024-01-16 23:12:30 +0000 Commit: Allan Jude CommitDate: 2024-01-16 23:15:00 +0000 Fix KASSERT in 80044c78 causing build failures Move the KASSERT to where struct ip6_hdr is populated Fixes: 80044c785cb040a2cf73779d23f9e1e81a00c6c3 Reported-by: bapt Reviewed-by: markj Sponsored-by: Klara, Inc. --- sys/netipsec/udpencap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netipsec/udpencap.c b/sys/netipsec/udpencap.c index 960e7d3d1c9f..e5b286b5ae69 100644 --- a/sys/netipsec/udpencap.c +++ b/sys/netipsec/udpencap.c @@ -259,8 +259,6 @@ udp_ipsec_output(struct mbuf *m, struct secasvar *sav) #endif #ifdef INET6 case AF_INET6: - KASSERT(ip6->ip6_nxt == IPPROTO_ESP, - ("unexpected next header type %d", ip->ip6_nxt)); hlen = sizeof(struct ip6_hdr); break; #endif @@ -297,6 +295,8 @@ udp_ipsec_output(struct mbuf *m, struct secasvar *sav) struct ip6_hdr *ip6; ip6 = mtod(m, struct ip6_hdr *); + KASSERT(ip6->ip6_nxt == IPPROTO_ESP, + ("unexpected next header type %d", ip6->ip6_nxt)); ip6->ip6_plen = htons(m->m_pkthdr.len); ip6->ip6_nxt = IPPROTO_UDP; udp->uh_sum = in6_cksum_pseudo(ip6,