From patchwork Mon Apr 22 11:05:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3686 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:57c6:b0:571:36e9:c9de with SMTP id v6csp2724348mau; Mon, 22 Apr 2024 04:06:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVD8tDwSVT6IxBo1Tmf9hEWbQdlGTUhOG2jIwG+G2P0up86SUX3TqSZr9gbQ43qWHtoWyeyPeKgWBVDMVK0Wi4ZjK1tKZo= X-Google-Smtp-Source: AGHT+IG66tnGmeIlJv+dqZB2ATRbx1fUbe4qF7+R0r8yfthucvAAoCdVuBrjuv4VgHbTUiSdsiaD X-Received: by 2002:a05:6a20:b298:b0:1aa:9715:ce5d with SMTP id ei24-20020a056a20b29800b001aa9715ce5dmr11352592pzb.2.1713783965461; Mon, 22 Apr 2024 04:06:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713783965; cv=none; d=google.com; s=arc-20160816; b=rq8LOaEaXg0Y1ABHovb2f7T/lTtQgNSyswsQpriabTr5gj/ZfR/P3fVFROj7a28uQY 8CjigP6Kcg1IsdWeUwgHdi/pdVkMja/HNhiPbIHaxlnnOhFuCS0rpalk/K6h+TT3O+/L KLGYlDN9k+Wz68YQ3dM+QJYl/3JclQpnao7IhmocGOyeFdZQRRdGgg/cKOSJ6ksCU0YH 5uRLhptWZNNPoRYET+atOS0tkrW7bYANvQYV3JJSvGfqeZvemtvkpsd8W0IGnYa6MeLd tuICn6OEGQ84RlurmhoroVIaby3cF+btdb5ay6g4mj5M54xDUGoNBGJmfzg2TS1Cm+ar OhAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=H1QqKi1diiZu1PlXquso3eCuUaX34CAvAeV4KA24C6I=; fh=U7wEyxtwz2o5+UdevFSA47vNeG9knhWH0KV//QhD5a0=; b=qYSpHCjLKqqJMavIxv6ubV6Im0htcCEZcZWBdiv86TS7J55yoFXFWQdS7/0LOIMhbj gEtuVzKUR9O+M0xwVCsWGe+P+o2RXHC4MGGuCwhHi2KEWB6zAv39tCqCCj9QJg0WSVMx /WiBocmowHsV5jCHRlko3cnWYKADc6HJpuHSyylYeB3sFcZx6nb22qBLO26o4/KZYY8y Da6ooS+looXGItYePMc/RqPU09rsp6pF9zetpZsGSjRcS1+Woc3V9LCeoLXDcQLJhTPk Sj+0r7w0CcGUHcrIhqBQ0MG3xgAPeWTMaV6GCNHl6JIZinVNR+uBkT1SuVLepPSSc47D 3p3A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="c5b5eJX/"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=UCkEBkaJ; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=RNwCcaUI; 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=openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id f3-20020a170902860300b001e2a31c0f5dsi7397724plo.340.2024.04.22.04.06.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Apr 2024 04:06:05 -0700 (PDT) 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="c5b5eJX/"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=UCkEBkaJ; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=RNwCcaUI; 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=openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1ryrUK-0005S6-Sa; Mon, 22 Apr 2024 11:05:33 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1ryrUJ-0005Rz-F9 for openvpn-devel@lists.sourceforge.net; Mon, 22 Apr 2024 11:05:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=OvrdmHZJ99cTEa2r5WCEtu3usXxB7RouoY//Z/Ez4LU=; b=c5b5eJX/a6kraAoL7fSO1e7nJf kz4vKQFIwNGr4SLGEpUb5O3rIOcbm18ZWV0w5XtYwoXN7N+oAu0eR/fbLPE0MSlO7bzKM5hgS/E7X e65Nh9AJTigJTzfMbfwaz+VFTNhWrRDdwtI5KyYBdbjwUunaI5w71EaXwA9+rLInkohE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=OvrdmHZJ99cTEa2r5WCEtu3usXxB7RouoY//Z/Ez4LU=; b=U CkEBkaJfb4CC9rE/2EWUagIJQvukNultU4vFiJXYZHkvn1DlMQbQxD1HRw2WioNb4qj+JuL6A0FcH tNLYiNdrMP5YrA29wI1Mfk9zxfXyULNsDh+mb7Y3tuhTW1BTFBhj/C4aJfR4SefGWebqaGHFNJdi0 HI5uYI4i94z1nIQU=; Received: from mail-wm1-f44.google.com ([209.85.128.44]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1ryrUH-00008x-Uv for openvpn-devel@lists.sourceforge.net; Mon, 22 Apr 2024 11:05:31 +0000 Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-41a523e2888so5487135e9.1 for ; Mon, 22 Apr 2024 04:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1713783924; x=1714388724; darn=lists.sourceforge.net; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=OvrdmHZJ99cTEa2r5WCEtu3usXxB7RouoY//Z/Ez4LU=; b=RNwCcaUIqpS3Jc52LWJXGWEmJ7xLx0cq+rIttlCYwUDAsiVF3WPSowx6hZNMK2R39O 3OaCrOxG2TmGBZozOBJm/GHmHap0KaIf3e6jUr4xbMwh+7LJ5aGnhbGiN5uzKHyPDmAX zHURTEDl0sMrY/+UUq1M2KNl0yM/61k8i4WhiTog9LaIdzeMebUXyNcjmAxWP07P/3W9 YFuLj7JPfQDw759+2cFaPH8wqQC880B2t1SAJjDWNZ4iR1+zyWfmHdc3r6lb9qh6eFm5 OwsK7Hf3T54YutaxpFadXL94gDkLN4yD3ZumqEnLpRAs+pnxSUvQpIJ2bC42BCgpxCnv b//g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713783924; x=1714388724; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OvrdmHZJ99cTEa2r5WCEtu3usXxB7RouoY//Z/Ez4LU=; b=IeOIDk6dLa9D/+GkQeRKSo392WuMj49LwntmkdrGCNtP7JYnIEbUx61azd7uIpgpud 2NHGC71UEaFhySZhEp9Nl6n4PHzlxBH+gVQyJ3MALeal4YdL30+ziI9fnb/5NRUlnqvA KqJG0K2QT6Q2G/KK7XrEgnAj12hsTqkprZU5FiaDLRdHaJ7ejXKrlyJLRCWW4jat+/8D zxcU81D93CIUVk+biasHMq6sPNKjXOuU91baO/ddcOf9YiU89SHQS4CqXYPTAmAU9MIY Nw99x+bmZq6nhGGVrzmdJI5IqqhSO4E08q7Cn1mX4aHnELXv6BL5kSKwnLV7Q7kmJ7tF mzwA== X-Gm-Message-State: AOJu0YyBS1bnDOwHgQXciR0z5ykDxGc3j08HYLq0ifNs8MJM+fcTqz8g 9FsVUsoah0SizLTkqA3B5Dw0HgYCHCpP3/RIfFI+2rfBsLQNLs6pZi1/GkHrC5s= X-Received: by 2002:a5d:66cd:0:b0:343:878d:d691 with SMTP id k13-20020a5d66cd000000b00343878dd691mr6909284wrw.47.1713783923866; Mon, 22 Apr 2024 04:05:23 -0700 (PDT) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id l10-20020a5d410a000000b00343d1d09550sm11773795wrp.60.2024.04.22.04.05.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 04:05:23 -0700 (PDT) From: "reynir (Code Review)" X-Google-Original-From: "reynir (Code Review)" X-Gerrit-PatchSet: 1 Date: Mon, 22 Apr 2024 11:05:22 +0000 To: plaisthos , flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I9457f005f4ba970502e6b667d9dc4299a588d661 X-Gerrit-Change-Number: 555 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 2fb60a8651262283fed79366eb4d53df5f769228 References: Message-ID: MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.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: Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: openvpn.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.44 listed in wl.mailspike.net] 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1ryrUH-00008x-Uv Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Only schedule_exit() once 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: , Reply-To: reynir@reynir.dk, arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1797032735081378029?= X-GMAIL-MSGID: =?utf-8?q?1797032735081378029?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/555?usp=email to review the following change. Change subject: Only schedule_exit() once ...................................................................... Only schedule_exit() once If an exit has already been scheduled we should not schedule it again. Otherwise, the exit signal is never emitted if the peer reschedules the exit before the timeout occurs. Change-Id: I9457f005f4ba970502e6b667d9dc4299a588d661 Signed-off-by: Reynir Björnsson --- M src/openvpn/forward.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/55/555/1 diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c index 8d10f25..70f8e9d 100644 --- a/src/openvpn/forward.c +++ b/src/openvpn/forward.c @@ -519,6 +519,11 @@ void schedule_exit(struct context *c, const int n_seconds, const int signal) { + /* don't reschedule if already scheduled; we drop the new signal, but it + * only ever seems to be SIGTERM anyway. */ + if (event_timeout_defined(&c->c2.scheduled_exit)) { + return; + } tls_set_single_session(c->c2.tls_multi); update_time(); reset_coarse_timers(c);