| Message ID | 20230112163737.1240059-1-arne@rfc2549.org |
|---|---|
| State | Accepted |
| 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 p21csp5291446dyk;
Thu, 12 Jan 2023 08:38:18 -0800 (PST)
X-Google-Smtp-Source:
AMrXdXtvrEwlMuFtQUzZMmP/YH63k99ofIPLxgRrNqBIqPEAnyd0DBu9BX5BNBcZWQWkt6h8/aXg
X-Received: by 2002:a17:902:b281:b0:189:e360:ce5 with SMTP id
u1-20020a170902b28100b00189e3600ce5mr6791348plr.12.1673541497940;
Thu, 12 Jan 2023 08:38:17 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1673541497; cv=none;
d=google.com; s=arc-20160816;
b=VboTuyM14OC57gH+1SNoO2VtgQXvP65UYGvnnVmqUuDsge6oe9o1LcTHu0YGfTz9Xc
jW+cBdZTjRdJhIONgmIuCf88vusUdctR8gd6XNkicBS23FYIvWmW8EhLDk3gTAMEIZ74
GCLc9pIAc36uswfZS43C3qvFxLFiYi9OIdIFd9bo0XTfc3T1O7oLuQLQNr2HXEnbbRMU
fR8Azbkc8CYAL3oMLURphyXHmwAcChpYbrEld6SLjyK+CG0Sa7tt3/CjCOIr6rfNVOST
AWIypQeli5UUH75BW5ymZZQE85BCX5f7sKGUwPnnV1i9TV13uDaenzLWlWuzYFKBoh0m
wHkg==
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:message-id:date:to:from:dkim-signature:dkim-signature;
bh=VPtuLtfJyiRM0BDkf3IH6z5rRWXt89YTUfpJsnDBSgc=;
b=pBiNwz9/deMmd774LphVlgjjEenPA+GN4dfxOhlayeIW4zg9hXrqJLURa1zDVsEMgK
bViXhzR7yGp157b1ZUbvMAn8SeVgzxL0iGg6ioNSuAMDt3N945zZUl+y+ZPW3Tzga6oG
1q+yQ3mEU02b8LFqK6Go27Qs65ZWQSl5B7/lswjCdaJAIZetSfjTnPLMPb8Hnc2aIPF1
A4zn+7Y+QMsLn3u8+Hca3giNfOCn1sMYIfd94TN5DTd3MTwdxZ4+NNigoiYls4DyY6OM
Ugvji/bI/srFAbVYqLsrkr+G8z94YLsTYeWJ0N6C8e+M+sRB2PaeON+bau2U6SJyw3i7
2GBg==
ARC-Authentication-Results: i=1; mx.google.com;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=UwwGBQN8;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=lh0qw14b;
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
u9-20020a170903124900b00188d892999esi18920999plh.521.2023.01.12.08.38.17
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Thu, 12 Jan 2023 08:38:17 -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=UwwGBQN8;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=lh0qw14b;
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-4.v29.lw.sourceforge.com)
by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95)
(envelope-from <openvpn-devel-bounces@lists.sourceforge.net>)
id 1pG0aO-0006N7-2U;
Thu, 12 Jan 2023 16:37:50 +0000
Received: from [172.30.20.202] (helo=mx.sourceforge.net)
by sfs-ml-4.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 1pG0aJ-0006Mw-PF
for openvpn-devel@lists.sourceforge.net;
Thu, 12 Jan 2023 16:37:46 +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: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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:
List-Subscribe:List-Post:List-Owner:List-Archive;
bh=8l5i+3KZlxCyiMZZ23/aQ0fOvfjGAQI/4/XY9rdSklQ=; b=UwwGBQN85J0NakCcVILZJ1VpQ4
2MudsemXy78zH6JNVxigapvAzMEmNPP29Gwrjkz5Bk5XbujfptEVzHiN/Krb0i73l/9fgirUfrdd/
4OUysXkLUaClWzRopdM7zf+fX0EIhFzSyEzzUQuPGCkAkUyvJyYJJs7s0F9drwcNtuiI=;
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x
;
h=Content-Transfer-Encoding:MIME-Version: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:In-Reply-To:
References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:
List-Owner:List-Archive; bh=8l5i+3KZlxCyiMZZ23/aQ0fOvfjGAQI/4/XY9rdSklQ=; b=l
h0qw14bRbAsciU1tmZvpETyKE9+loP2e7Q8uxiP8SkenRgWaZFwjYcEGnXLTlbymr7imzFbL+aozA
eY0DuNsYHWBcclw5QNCp8+Ho0DTeauudA4oBLAUdIoQBSegFHreDXcfQpo/fr6ELdBlaPMvAN8Hju
e9ypy3bg5G7pWfKM=;
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 1pG0aG-001FrE-NC for openvpn-devel@lists.sourceforge.net;
Thu, 12 Jan 2023 16:37:46 +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 1pG0a9-000K7T-CC
for openvpn-devel@lists.sourceforge.net;
Thu, 12 Jan 2023 17:37:37 +0100
Received: (nullmailer pid 1240105 invoked by uid 10006);
Thu, 12 Jan 2023 16:37:37 -0000
From: Arne Schwabe <arne@rfc2549.org>
To: openvpn-devel@lists.sourceforge.net
Date: Thu, 12 Jan 2023 17:37:37 +0100
Message-Id: <20230112163737.1240059-1-arne@rfc2549.org>
X-Mailer: git-send-email 2.25.1
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 workaround avoids the kernel trigger ENOBUFS when the
kernel internal queue is overrun with events of disconnectingh clients or
similar. This is a workaround until we come up with a more permanen [...]
Content analysis details: (0.3 points, 6.0 required)
pts rule name description
---- ----------------------
--------------------------------------------------
0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
mail domains are different
0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
0.0 SPF_NONE SPF: sender does not publish an SPF Record
X-Headers-End: 1pG0aG-001FrE-NC
Subject: [Openvpn-devel] [PATCH] Workaround: make ovpn-dco more reliable
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?1754835449888980169?=
X-GMAIL-MSGID: =?utf-8?q?1754835449888980169?=
|
| Series |
[Openvpn-devel] Workaround: make ovpn-dco more reliable
|
|
Commit Message
Arne Schwabe
Jan. 12, 2023, 4:37 p.m. UTC
This workaround avoids the kernel trigger ENOBUFS when the kernel
internal queue is overrun with events of disconnectingh clients or
similar. This is a workaround until we come up with a more permanent
solution.
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
---
src/openvpn/dco_linux.c | 5 +++++
1 file changed, 5 insertions(+)
Comments
Hi, On 12/01/2023 17:37, Arne Schwabe wrote: > This workaround avoids the kernel trigger ENOBUFS when the kernel > internal queue is overrun with events of disconnectingh clients or > similar. This is a workaround until we come up with a more permanent > solution. > > Signed-off-by: Arne Schwabe <arne@rfc2549.org> After further discussion and deeper testing, we concluded that it is possible to generate so much netlink traffic that we can easily fill the buffers and start losing message or get desync'd with kernelspace. The long term solution is improving ovpn-dco (kernel module) to reduce such traffic, however, for now it makes sense to extend the userspace buffer in order to decrease the likelihood of filling it up during normal operations. Therefore this patch gets my ACK: Acked-by: Antonio Quartulli <a@unstable.cc> [please add spaces around the '*' operator] > --- > src/openvpn/dco_linux.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c > index 5524cdbcd..c84f9cfe1 100644 > --- a/src/openvpn/dco_linux.c > +++ b/src/openvpn/dco_linux.c > @@ -375,6 +375,11 @@ ovpn_dco_init_netlink(dco_context_t *dco) > * wrong sequence numbers (NLE_SEQ_MISMATCH), so disable libnl's sequence > * number check */ > nl_socket_disable_seq_check(dco->nl_sock); > + > + /* nl library sets the buffer size to 32k/32k by default which is sometimes > + * overrun with very fast connecting/disconnecting clients. > + * TODO: fix this in a better and more reliable way */ > + ASSERT(!nl_socket_set_buffer_size(dco->nl_sock, 1024*1024, 1024*1024)); > } > > bool
"Another bandaid so 2.6 does not fall apart right away"... but anyway,
while not pretty, it seems to get the job done...
Tested on the Ubuntu 20.04 / DCO server, client and server.
Your patch has been applied to the master and release/2.6 branch.
commit f84a9fc5d4ac0f24912d239a3fccf3701926a50c (master)
commit 74a7cf9b9b9a4cb04d0bff9a85880e9bafbefca8 (release/2.6)
Author: Arne Schwabe
Date: Thu Jan 12 17:37:37 2023 +0100
Workaround: make ovpn-dco more reliable
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <20230112163737.1240059-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25988.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
--
kind regards,
Gert Doering
diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c index 5524cdbcd..c84f9cfe1 100644 --- a/src/openvpn/dco_linux.c +++ b/src/openvpn/dco_linux.c @@ -375,6 +375,11 @@ ovpn_dco_init_netlink(dco_context_t *dco) * wrong sequence numbers (NLE_SEQ_MISMATCH), so disable libnl's sequence * number check */ nl_socket_disable_seq_check(dco->nl_sock); + + /* nl library sets the buffer size to 32k/32k by default which is sometimes + * overrun with very fast connecting/disconnecting clients. + * TODO: fix this in a better and more reliable way */ + ASSERT(!nl_socket_set_buffer_size(dco->nl_sock, 1024*1024, 1024*1024)); } bool