From patchwork Thu Jan 12 16:37:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 2999 Return-Path: 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 ) 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 ) 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 ) 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 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: 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?1754835449888980169?= X-GMAIL-MSGID: =?utf-8?q?1754835449888980169?= 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 Acked-by: Antonio Quartulli --- 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