From patchwork Fri Nov 7 16:50:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4571 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:d11a:b0:7b1:1082:6501 with SMTP id lw26csp644008mab; Fri, 7 Nov 2025 08:50:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUKzHRPtypa4jeFW2f5TWvEyHCqZxvHbn/pa9nSJ1LwGlfy2l2A+vM2RbpQdbw9pn8MLxt56hVYv3k=@openvpn.net X-Google-Smtp-Source: AGHT+IEj+6voYT6roJ/IxR07pk0niGX4PE/JeS3C9T9iNZGzK+jQxV8yUVSnUXX58LFOAfP2snmn X-Received: by 2002:a05:6830:927:b0:7b9:4dd5:1963 with SMTP id 46e09a7af769-7c6effbeb64mr2857578a34.24.1762534257529; Fri, 07 Nov 2025 08:50:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1762534257; cv=none; d=google.com; s=arc-20240605; b=jM/HWjDlEhPQOCUzwMAwl4tD9nkHL3mrdRuVUNJjxNL4NkjuE7+I5gKRJQJhYE4aBN B/b3FAQM7mwa4c5Jp4EOOzK3Hqy5xZcWj399nGf4mUVv6FduEyKhoytpXjW/QbRxOSzY Gqzh/Hm7BYpZYsWlyYZXt4qzaXGlcKLRqV/FoHcYQJC/ENfmC6lFEQzDPZf+Ufkik/j6 nDxu95zombyje6VAp1In1KboEFlS3lTbDZXEu3ghyjVk7sV/BfRrGJCJbUviAGJQt+xI 1euuLqJEELKN83cnl32l9l4hoIAWE0orU4X5W4F6F38fBNjtlVGsN1IshZJUnP8w64/W SGKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=ZzfxozGj88J26SnwPYaYBMJIl+wZH+TJSj8wSzsllQo=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=XSlWiwzvn/4f/JY76MmqMUylHwIWbn6YOtY130yGxidmlOS8Yy0DndvWqtbosKpbGA FUgLGuSFVB3/iriPGaVrXaoi12uDFzFjNL/6gOUkR4+tHqJ4UbvbfXK4StgUZyNTAODs hvQcmtHBsaDQnSeirvrdYzMQmQG/DiwCvaJitT0ufwwUX5w9ecMcQ656ssoinXKvP/PK Ky7W5PJr9sNo3bKR9Ha6Q/jXDDngM+/oHBb4leHIuyHNRO96Y6LMJcJok5CsU0itv4qi Dg42boO/PM/lQXtp0KWjpWzzbwTdV/2oxHz3rkKnWegaRVYf8smBWDx1YI2gqAaiKjIR dp5A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=iXXwAfow; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=A3EC5cKT; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=BfzhtvjC; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 46e09a7af769-7c6f10c360esi1097070a34.212.2025.11.07.08.50.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Nov 2025 08:50:57 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=iXXwAfow; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=A3EC5cKT; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=BfzhtvjC; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZzfxozGj88J26SnwPYaYBMJIl+wZH+TJSj8wSzsllQo=; b=iXXwAfowkpq9m+LsRbGlhGNlgj XRz7DQPa0U86pSvDnzos6eTu0+IJpph4797lT1MX8601fhHcoKFgs9SmR1CzQa0R+vrPjYCSkA9oh pGzUp3Q/4DDyoEBmHlL0A5GsWJI+YNw19gfiyKiYywdcu9GxO5s/RSQRByU8CMBptQ7Q=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1vHPfp-0003Pg-RJ; Fri, 07 Nov 2025 16:50:54 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vHPfn-0003PN-SW for openvpn-devel@lists.sourceforge.net; Fri, 07 Nov 2025 16:50:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=V0Hb0jm6tFYFM8BZYSHHXIQ99P2K/A+tf5xqiu3aWBQ=; b=A3EC5cKT9srf2CEYsuPeQMlwec c/tFKWSbDtrSR3k8gbv+ddte287zv9dwj6m9RIUrsWxyx/5otuIkokv96PD9uvq66ywyEab3RhhlU YiX7R+XbDjaD+jUHtQQLMrOQku7QokMTAX/3P7MST4yyh9yauKIjj/pnUKSkLQkwBoEM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=V0Hb0jm6tFYFM8BZYSHHXIQ99P2K/A+tf5xqiu3aWBQ=; b=BfzhtvjCe/cPqghG4ho2jBZ+A6 yxHi6s1Ud22hb7bj5J3lVfMiej8Cu9rtOudZHp3Lh6BsyEmKAEHaNwKaYaZ39fvlC4g+Tdc8UqIOo IYNCrKQuhbwfzG6B3m0RptwVRYQFbCINpAbQPLhfdi5gm4munEbOu7vjDdo18FOCxiZE=; Received: from [193.149.48.134] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vHPfm-0007N7-Kj for openvpn-devel@lists.sourceforge.net; Fri, 07 Nov 2025 16:50:51 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 5A7GocOx026198 for ; Fri, 7 Nov 2025 17:50:38 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 5A7GocPX026197 for openvpn-devel@lists.sourceforge.net; Fri, 7 Nov 2025 17:50:38 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Fri, 7 Nov 2025 17:50:29 +0100 Message-ID: <20251107165038.26171-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Some of these debug messages only existed on Linux, and made debugging DCO issues on FreeBSD more difficult. Add them, using the same style as used for dco_linux.c While at it, change all format strings for "peerid" to "%u" (wherever appropriate, dco->dco_message_peer_id is an "int" today and changing this to uint32_t is out of scope for "make better logging") Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1vHPfm-0007N7-Kj Subject: [Openvpn-devel] [PATCH v3] dco_freebsd.c: add D_DCO_DEBUG messages for counters and notifications X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1848151121688802660?= X-GMAIL-MSGID: =?utf-8?q?1848151121688802660?= Some of these debug messages only existed on Linux, and made debugging DCO issues on FreeBSD more difficult. Add them, using the same style as used for dco_linux.c While at it, change all format strings for "peerid" to "%u" (wherever appropriate, dco->dco_message_peer_id is an "int" today and changing this to uint32_t is out of scope for "make better logging") Change-Id: Ife55cb78401dad921b75f6c86d9bd0642f6a6e83 Signed-off-by: Gert Doering Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1349 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1349 This mail reflects revision 3 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c index 3521fca..f80b6df 100644 --- a/src/openvpn/dco_freebsd.c +++ b/src/openvpn/dco_freebsd.c @@ -147,7 +147,7 @@ nvl = nvlist_create(0); - msg(D_DCO_DEBUG, "%s: peer-id %d, fd %d", __func__, peerid, sd); + msg(D_DCO_DEBUG, "%s: peer-id %u, fd %d", __func__, peerid, sd); if (localaddr) { @@ -363,7 +363,7 @@ nvlist_t *nvl; int ret; - msg(D_DCO_DEBUG, "%s: peer-id %d", __func__, peerid); + msg(D_DCO_DEBUG, "%s: peer-id %u", __func__, peerid); nvl = nvlist_create(0); nvlist_add_number(nvl, "peerid", peerid); @@ -392,7 +392,7 @@ nvlist_t *nvl; int ret; - msg(D_DCO_DEBUG, "%s: peer-id %d", __func__, peerid); + msg(D_DCO_DEBUG, "%s: peer-id %u", __func__, peerid); nvl = nvlist_create(0); nvlist_add_number(nvl, "peerid", peerid); @@ -421,7 +421,7 @@ nvlist_t *nvl; int ret; - msg(D_DCO_DEBUG, "%s: peer-id %d, slot %d", __func__, peerid, slot); + msg(D_DCO_DEBUG, "%s: peer-id %u, slot %d", __func__, peerid, slot); nvl = nvlist_create(0); nvlist_add_number(nvl, "slot", slot); @@ -493,7 +493,7 @@ nvlist_t *nvl, *encrypt_nvl, *decrypt_nvl; int ret; - msg(D_DCO_DEBUG, "%s: slot %d, key-id %d, peer-id %d, cipher %s, epoch %d", __func__, slot, keyid, peerid, + msg(D_DCO_DEBUG, "%s: slot %d, key-id %d, peer-id %u, cipher %s, epoch %d", __func__, slot, keyid, peerid, ciphername, epoch); nvl = nvlist_create(0); @@ -539,7 +539,7 @@ nvlist_t *nvl; int ret; - msg(D_DCO_DEBUG, "%s: peer-id %d, ping interval %d, ping timeout %d", __func__, peerid, + msg(D_DCO_DEBUG, "%s: peer-id %u, ping interval %d, ping timeout %d", __func__, peerid, keepalive_interval, keepalive_timeout); nvl = nvlist_create(0); @@ -569,7 +569,7 @@ { if (peerid >= m->max_clients || !m->instances[peerid]) { - msg(M_WARN, "dco_update_peer_stat: invalid peer ID %d returned by kernel", peerid); + msg(M_WARN, "dco_update_peer_stat: invalid peer ID %u returned by kernel", peerid); return; } @@ -577,6 +577,9 @@ mi->context.c2.dco_read_bytes = nvlist_get_number(nvl, "in"); mi->context.c2.dco_write_bytes = nvlist_get_number(nvl, "out"); + + msg(D_DCO_DEBUG, "%s: peer-id %u, dco_read_bytes: " counter_format " dco_write_bytes: " counter_format, + __func__, peerid, mi->context.c2.dco_read_bytes, mi->context.c2.dco_write_bytes); } int @@ -614,6 +617,7 @@ dco->dco_message_peer_id = nvlist_get_number(nvl, "peerid"); type = nvlist_get_number(nvl, "notification"); + switch (type) { case OVPN_NOTIF_DEL_PEER: @@ -631,6 +635,8 @@ dco->dco_del_peer_reason = OVPN_DEL_PEER_REASON_USERSPACE; } } + msg(D_DCO_DEBUG, "%s: received NOTIF_DEL_PEER for peer-id=%d, reason=%d", __func__, + dco->dco_message_peer_id, dco->dco_del_peer_reason); if (nvlist_exists_nvlist(nvl, "bytes")) { @@ -651,6 +657,8 @@ break; case OVPN_NOTIF_ROTATE_KEY: + msg(D_DCO_DEBUG, "%s: received NOTIF_ROTATE_KEY for peer-id=%d", __func__, + dco->dco_message_peer_id); dco->dco_message_type = OVPN_CMD_SWAP_KEYS; break; @@ -670,12 +678,14 @@ msg(M_WARN, "Failed to parse float notification"); break; } + msg(D_DCO_DEBUG, "%s: received NOTIF_FLOAT for peer-id=%d", __func__, + dco->dco_message_peer_id); dco->dco_message_type = OVPN_CMD_FLOAT_PEER; break; } default: - msg(M_WARN, "Unknown kernel notification %d", type); + msg(M_WARN, "%s: unknown kernel notification %d", __func__, type); break; } @@ -815,6 +825,8 @@ return 0; } + msg(D_DCO_DEBUG, __func__); + CLEAR(drv); snprintf(drv.ifd_name, IFNAMSIZ, "%s", dco->ifname); drv.ifd_cmd = OVPN_GET_PEER_STATS; @@ -873,6 +885,7 @@ int dco_get_peer_stats(struct context *c, const bool raise_sigusr1_on_err) { + msg(D_DCO_DEBUG, __func__); /* Not implemented. */ return 0; }