| Message ID | 20221227022404.3468137-4-arne@rfc2549.org |
|---|---|
| State | Changes Requested |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net>
Delivered-To: patchwork@openvpn.net
Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp2355355dyk;
Mon, 26 Dec 2022 18:24:52 -0800 (PST)
X-Google-Smtp-Source:
AMrXdXvqGTz/AivivOeY6n0r3VT7yEpHrhAoxhyKenHjD/nbSY244vwLQgSKh1CYNm2K4q8WG8fs
X-Received: by 2002:a05:6a00:1255:b0:576:b8e1:862b with SMTP id
u21-20020a056a00125500b00576b8e1862bmr26589447pfi.14.1672107891999;
Mon, 26 Dec 2022 18:24:51 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1672107891; cv=none;
d=google.com; s=arc-20160816;
b=OogkQqI7lY7pyslW0he4D7jI8WN94l8ad2aa0QLo9QusIdnq4k+ySGwBkQ3zW1PDqv
657R9bQjviSukVXeGpkmVXHlSlXT3eAhpsBEoW9ujEwOL0L3YKQkNQS1Oyl3Moiaxx8Y
s7XTJyJLtIivCmYIBImXaBgZ9LCyc67fPma+7rHax0oUnnWf0C2LlxIlX6DRTbx3chQe
H6vCGj6g8/K7JRi0MxaXRdDaoZjF92542+JlSM8AUqN03ZBrW5aHdLqbx0jUPbXLnSeA
clNkN1Aj2aYtmZBmg9izGBg1edczZUoB8MrI75sZWt6HCx6DpgyXeBBBlrOMLqMt4MZA
+IYg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20160816;
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;
bh=xdgg0K2ljkRnGu70qTnduUVKqWf7rICVOoLDHJBMHQw=;
b=0KvWGZQKbYlUGiX8/Bb4dDDltx8g1ctKkEfmTH6O+fBv1zCY8xNOAWcXHH3NTK3oi4
24vFvGX/3etin7xH1CtL/iS8bRRt7zKHtnRVYR5Q+rFQFSPWhBvxSyYNsBmTUyi3sKVu
KuEFkFcR9bFSN4cFnE6imkgM4greDaNlSVeDRi8sboFQe+XnY8EESBCgOsJ20nLnkVCQ
XnBVZbsdSHc7qUwbNREosW0sqg2B6x5da8GBlXbSEM9zrwuW9TKTtRHtr3cwYMqjDmmT
t2aTbAir3u6IEyfoSCVcVL0UrlnfzFgVSMMOLlLWTiGX/5IUM92hHXKnBPJe5A9/f+CR
uvKw==
ARC-Authentication-Results: i=1; mx.google.com;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=I1SH1THy;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b="NfnEaKu/";
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
Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7])
by mx.google.com with ESMTPS id
q15-20020a056a00150f00b0054252c63d75si11763623pfu.98.2022.12.26.18.24.51
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Mon, 26 Dec 2022 18:24:51 -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=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=I1SH1THy;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b="NfnEaKu/";
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
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 <openvpn-devel-bounces@lists.sourceforge.net>)
id 1p9zdj-0005qY-0l;
Tue, 27 Dec 2022 02:24:27 +0000
Received: from [172.30.20.202] (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 <arne@kamera.blinkt.de>) id 1p9zdX-0005qM-Lc
for openvpn-devel@lists.sourceforge.net;
Tue, 27 Dec 2022 02:24:16 +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=hyxCxazwdCYX2DHq09F0tFh/rOvhE6tIv1pWUbyKNKE=; b=I1SH1THywP+1zAj2YDdl9HTb3k
8b9dWJxKjJMwPGz6o9y1lDIBmEE+JlBLGdBayhCp31kYqsOnBMI4UKepvzSf4rktJX6Y126HHEYst
VVA2jk2cU8lUP7VKK/ASGtU+fOnwjGlcIDvIVIhlWx39gNG05p5/T4nAJyJ63u2cknt4=;
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=hyxCxazwdCYX2DHq09F0tFh/rOvhE6tIv1pWUbyKNKE=; b=NfnEaKu/1xd+No3BPGDKoy9xu4
WOBqofmV0NewjmnGjV1QBzG84QzBJcoWDeFXwQdYPvm2EVwvQRDNdX6Nw6a3E//0rLSepJJ5auwPO
5NWwsKOQ3QSv5s2aI0yH2ssCpTGNr7BZH7A0E9BK7LUgyrCE9bAWIRzO3fUTQnync8t4=;
Received: from mail.blinkt.de ([192.26.174.232])
by sfi-mx-1.v28.lw.sourceforge.com with esmtps
(TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95)
id 1p9zdT-00DihK-D0 for openvpn-devel@lists.sourceforge.net;
Tue, 27 Dec 2022 02:24:15 +0000
Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c])
by mail.blinkt.de with smtp (Exim 4.95 (FreeBSD))
(envelope-from <arne@kamera.blinkt.de>) id 1p9zdM-0002IY-3I
for openvpn-devel@lists.sourceforge.net;
Tue, 27 Dec 2022 03:24:04 +0100
Received: (nullmailer pid 3468191 invoked by uid 10006);
Tue, 27 Dec 2022 02:24:04 -0000
From: Arne Schwabe <arne@rfc2549.org>
To: openvpn-devel@lists.sourceforge.net
Date: Tue, 27 Dec 2022 03:24:04 +0100
Message-Id: <20221227022404.3468137-4-arne@rfc2549.org>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20221227022404.3468137-1-arne@rfc2549.org>
References: <20221227022404.3468137-1-arne@rfc2549.org>
MIME-Version: 1.0
X-Spam-Score: 0.3 (/)
X-Spam-Report: Spam detection software,
running on the system "util-spamd-1.v13.lw.sourceforge.com",
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: This enables logging the peer id in p2mp mode if dco is
enabled
and the log level is high enough Signed-off-by: Arne Schwabe
<arne@rfc2549.org>
--- src/openvpn/multi.c | 6 ++++++ 1 file changed, 6 insertions(+)
Content analysis details: (0.3 points, 6.0 required)
pts rule name description
---- ----------------------
--------------------------------------------------
0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
mail domains are different
0.0 SPF_NONE SPF: sender does not publish an SPF Record
X-Headers-End: 1p9zdT-00DihK-D0
Subject: [Openvpn-devel] [PATCH v2 4/4] Log peer-id if loglevel is
D_DCO_DEBUG and dco is enabled
X-BeenThere: openvpn-devel@lists.sourceforge.net
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <openvpn-devel.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive:
<http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel>
List-Post: <mailto:openvpn-devel@lists.sourceforge.net>
List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: openvpn-devel-bounces@lists.sourceforge.net
X-getmail-retrieved-from-mailbox: Inbox
X-GMAIL-THRID: =?utf-8?q?1753332204756481170?=
X-GMAIL-MSGID: =?utf-8?q?1753332204756481170?=
|
| Series |
[Openvpn-devel,v2,1/4] Ensure we do not promote a TA_TIMEOUT to a TA_READ event with dco
|
|
Commit Message
Arne Schwabe
Dec. 27, 2022, 2:24 a.m. UTC
This enables logging the peer id in p2mp mode if dco is enabled
and the log level is high enough
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
---
src/openvpn/multi.c | 6 ++++++
1 file changed, 6 insertions(+)
Comments
Hi, On Tue, Dec 27, 2022 at 03:24:04AM +0100, Arne Schwabe wrote: > This enables logging the peer id in p2mp mode if dco is enabled > and the log level is high enough Ho hum, this does not work for me... TLS/TCP server, DCO enabled, --verb 6... 2022-12-27 11:05:41 us=111855 something/194.97.140.21:16006 dco_do_write: peer-id 0, len=390 2022-12-27 11:05:41 us=111931 something/194.97.140.21:16006 dco_update_keys: peer_id=0 2022-12-27 11:05:42 us=173611 dco_do_read 2022-12-27 11:05:42 us=173764 ovpn-dco: received OVPN_PACKET_ATTR_PACKET, ifindex: 32018 peer-id: 0, len 22 2022-12-27 11:05:42 us=173825 something/194.97.140.21:16006 TCPv6_SERVER READ [22] from [AF_INET6]::ffff:194.97.140.21:16006: P_ACK_V1 kid=0 [ 5 ] DATA len=0 2022-12-27 11:05:42 us=267059 something/194.97.140.21:16006 dco_update_keys: peer_id=0 2022-12-27 11:05:43 us=423410 something/194.97.140.21:16006 dco_update_keys: peer_id=0 2022-12-27 11:05:58 us=584121 something/194.97.140.21:16006 dco_update_keys: peer_id=0 ... there *should* be a peer-id somewhere in that line... Playing around with the patch a bit, the offending piece seems to be "mi->context.options.verbosity >= D_DCO_DEBUG" - which is unsurprising, as D_DCO_DEBUG is not "6" but "LOGLEV(6, 69, M_DEBUG)", which translates to #define LOGLEV(log_level, mute_level, other) ((log_level) | ENCODE_MUTE_LEVEL(mute_level) | other) (numerically, D_DCO_DEBUG = 1157628038) The test for dco_enabled() works. gert
Hi, On Tue, Dec 27, 2022 at 11:12:44AM +0100, Gert Doering wrote: > Playing around with the patch a bit, the offending piece seems to be > "mi->context.options.verbosity >= D_DCO_DEBUG" - which is unsurprising, > as D_DCO_DEBUG is not "6" but "LOGLEV(6, 69, M_DEBUG)", which translates > to > > #define LOGLEV(log_level, mute_level, other) ((log_level) | ENCODE_MUTE_LEVEL(mute_level) | other) > > (numerically, D_DCO_DEBUG = 1157628038) ... looking at error.h, there is a "check_debug_level(flags)" thing, so changing the condition to + if (mi->context.c2.tls_multi + // && mi->context.options.verbosity >= D_DCO_DEBUG + && check_debug_level(D_DCO_DEBUG) + && dco_enabled(&mi->context.options)) + { + buf_printf(&out, " peer-id=%d", mi->context.c2.tls_multi->peer_id); + } works - "if --verb 6 or higher, *and* DCO, then have peer-id=%d as part if the prefix". Can you resend a v3? gert
diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 50d88f19a..f8366be28 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -473,6 +473,12 @@ multi_instance_string(const struct multi_instance *mi, bool null, struct gc_aren buf_printf(&out, "%s/", cn); } buf_printf(&out, "%s", mroute_addr_print(&mi->real, gc)); + if (mi->context.c2.tls_multi + && mi->context.options.verbosity >= D_DCO_DEBUG + && dco_enabled(&mi->context.options)) + { + buf_printf(&out, " peer-id=%d", mi->context.c2.tls_multi->peer_id); + } return BSTR(&out); } else if (null)