From nobody Wed May 08 11:19:56 2024 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 4VZCNY1VnNz5KsvC; Wed, 08 May 2024 11:19:57 +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 4VZCNX4ckWz49Z9; Wed, 8 May 2024 11:19:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715167196; 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=PLaPY+QeyfiWzjKHbAhJ47wSsbt1xryHBllCuRHfHgM=; b=mVdUv8OSKmZXJLH9aGWx8Z3EFTd9FlIx4CG6gh4/r1odp4PxYYjIJa4M3o4Bfk6n7M1QWu irP1Ok44HKdPqYudM4tulQAHb+ySjfgFt5/fmBUxshkF2ecYwVQrHw2KX3OMhOnM0tJiAI gB1hE1zZXbr1s0R9unVdVNztMxhLk4Qc5VAklVGqFz8ehMQwJykDbVDK0eefLYbc5IJjKt IV7kgHGbjrTy+1B5eqIM1xk5q13MBVAeMeDUiN6mVzTGRk1RomPIY7fpKzhfrK9rxJSlP5 fuGCJf3VnxIs4cYrizPHrPT2c+Uvzhrs78HQt1OGLvEGN7lMnr3QFI5cAS/vRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715167196; a=rsa-sha256; cv=none; b=WJufMoQYvf88fvg8XT0bwc3Yyb8eNOGDGPt80O95KLdReZ+9vlOUkxs36n0Zj7fgskfAZK i2VY14POjP7SPKs0gwZRND2h6deYpVf1Orm59YvwPfFqi45zG9N2gF4t7NT02AsJgJ76nh 6Uq0klQ4nj77Om60QwNneq3RkrszQWH8YV9972DCQMVDOsqrjgboETFH8dzYSlYSUh18b9 65yCXm8xpsZZFBkyupNTb8B++idHNJk5ngqn11RXTWUng5rF0Tx3C4dkbhP5KPuzdjrl4j Bm6AlkyVOeI8CzNZgSbAzHtYoIte9Wy87JpIAp0Cr8azWVfRS2uwyJ+z4u1tFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715167196; 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=PLaPY+QeyfiWzjKHbAhJ47wSsbt1xryHBllCuRHfHgM=; b=issHK+KVsSqXjff2/Luc3DSLSmjelDEBJiT/KnFqx1LVcN4JvtyxouILDslr4G/RP0PN83 GI3UrQPi738EuOaYxie1vE2u0E6rpaOl0XcuntdQGTIaRMjUdj9jKIiOl4VXisnJi4PDrc pZBn22nVGoWlj63eLw+upb2imyi6w4pV9+8uhRENqSwZtHC6V4yB8HRgBJ+kQeRkPTOeD5 sjG/dkQc94F62xIJ7wrmjS6NHTUjZRU/jLOWEWBK6I3n+nHWWNXgAwSWGWDdOVgsDFRSRW 7Orb3jf38jxVrgzMc3CjlCtinnaOXTNZNmpS9vT4+ngcbaVyKmf/P5xNgeH5WA== 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 4VZCNX424QzN38; Wed, 8 May 2024 11:19:56 +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 448BJuZq094613; Wed, 8 May 2024 11:19:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448BJuTB094610; Wed, 8 May 2024 11:19:56 GMT (envelope-from git) Date: Wed, 8 May 2024 11:19:56 GMT Message-Id: <202405081119.448BJuTB094610@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: cda57d955b25 - main - carp: assert that we are calling correct input function. We are. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cda57d955b250b538233117aad6443a907d6c109 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=cda57d955b250b538233117aad6443a907d6c109 commit cda57d955b250b538233117aad6443a907d6c109 Author: Gleb Smirnoff AuthorDate: 2024-04-29 22:54:57 +0000 Commit: Kristof Provost CommitDate: 2024-05-08 11:19:04 +0000 carp: assert that we are calling correct input function. We are. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D45037 --- sys/netinet/ip_carp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 332e76b492fa..de439df97c59 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -835,6 +835,7 @@ carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af, int ttl) bool multicast = false; NET_EPOCH_ASSERT(); + MPASS(ch->carp_version == CARP_VERSION_CARP); ifa = carp_find_ifa(m, af, ch->carp_vhid); if (ifa == NULL) { @@ -846,8 +847,7 @@ carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af, int ttl) CARP_LOCK(sc); /* verify the CARP version. */ - if (ch->carp_version != CARP_VERSION_CARP || - sc->sc_version != CARP_VERSION_CARP) { + if (sc->sc_version != CARP_VERSION_CARP) { CARP_UNLOCK(sc); CARPSTATS_INC(carps_badver); @@ -956,6 +956,7 @@ vrrp_input_c(struct mbuf *m, int off, sa_family_t af, int ttl, struct carp_softc *sc; NET_EPOCH_ASSERT(); + MPASS(vh->vrrp_version == CARP_VERSION_VRRPv3); ifa = carp_find_ifa(m, af, vh->vrrp_vrtid); if (ifa == NULL) { @@ -969,7 +970,7 @@ vrrp_input_c(struct mbuf *m, int off, sa_family_t af, int ttl, ifa_free(ifa); /* verify the CARP version. */ - if (vh->vrrp_version != CARP_VERSION_VRRPv3 || sc->sc_version != CARP_VERSION_VRRPv3) { + if (sc->sc_version != CARP_VERSION_VRRPv3) { CARP_UNLOCK(sc); CARPSTATS_INC(carps_badver);