From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id E0B0A5A026F for ; Tue, 27 Feb 2024 12:57:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709035031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u3qwgwHiwDurG1zWmdKgTkkZBiArXG94W31CNVJV3hI=; b=hOt7QuRLQsEnkxzH6oh2v4Sz88hj1epPsF7s6I00VDPAB7QCfT8DteHZ1C+H+IP9WqLVKw J80XpVlNTx6wCMqN1pINS7YPN0RMFx3YQMupm3L7fkGIb5F+jEZIZX4zQnd2M8cLGUrnn/ 5ssrFy2WRje4qrKcl2HxmN/u/S7LKno= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-683-ry4ii4CCMdqnGdPk3tk-8w-1; Tue, 27 Feb 2024 06:57:10 -0500 X-MC-Unique: ry4ii4CCMdqnGdPk3tk-8w-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a3e94bbb22dso295964366b.1 for ; Tue, 27 Feb 2024 03:57:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709035029; x=1709639829; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=u3qwgwHiwDurG1zWmdKgTkkZBiArXG94W31CNVJV3hI=; b=lJhpuAbW7Q5s06MyTXw/59YlipJgBhUFw2CUIW+BI7WaA8aZ1Nrvmf+NcwMxCJfUr6 6zX9g68k+WvWe9bI9+Zq6ZXlWT/bxjmq390pk4I5NCPw2NpEaEuTcze4anyRMKpcQM0B kS6MBwGHYuwKFyEVJR6JkC1nhNvjht0VFnxF1ay+J3TWGOyqQc5NE4hCYdEfG6V5bXvY 84Aig4M9VWOeBg9D+xtWHYgWf9PttdxxtvMgSeQ/+hNqloN0APWqFH2GxOLR6kux4Rlj sc2GY/RrOM6y60NMM+zi7BlR8wzSkhKgsON1c3keehUEOs9xZLmdCO21Pi3HvYZzcN4n 68Bg== X-Gm-Message-State: AOJu0Yyx0qpTGaGSwwVTypPqI0i+BEyqmLlx/1zv3BMWrgjGMbEU8iti aTZmqbsgAzKRZj4xl3kjlqTl7a8VO5A4UN9rqmTBOkB5p03qMW7v2Gw62dbVznRWPqT6BsT6nbP r3A2dCgmf68cHO4IAvDJZKWn8fTRGNcmLTwpvtqJddjWEjdrOAA== X-Received: by 2002:a17:906:454e:b0:a42:fb31:7463 with SMTP id s14-20020a170906454e00b00a42fb317463mr4793498ejq.25.1709035029202; Tue, 27 Feb 2024 03:57:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDBYvAUZnmhyfxg+dw0h0ND2MesbKfx1HW4fsfV1yKsTO2lViwvonFHcyzr8zt0cjL5SqbEg== X-Received: by 2002:a17:906:454e:b0:a42:fb31:7463 with SMTP id s14-20020a170906454e00b00a42fb317463mr4793484ejq.25.1709035028728; Tue, 27 Feb 2024 03:57:08 -0800 (PST) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id a23-20020a17090640d700b00a3d12d84cffsm687812ejk.167.2024.02.27.03.57.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2024 03:57:08 -0800 (PST) Date: Tue, 27 Feb 2024 12:56:32 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 3/7] udp: Unconditionally clear act flag in udp_timer_one() Message-ID: <20240227125632.6d5a5a3c@elisabeth> In-Reply-To: <20240221232115.1376333-4-david@gibson.dropbear.id.au> References: <20240221232115.1376333-1-david@gibson.dropbear.id.au> <20240221232115.1376333-4-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.36; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 2LU45CZCH7KODKZPNHD6224JTNCNY6V2 X-Message-ID-Hash: 2LU45CZCH7KODKZPNHD6224JTNCNY6V2 X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: [Sorry, I wrote this comment a while ago and just now realised I didn't send this out...] On Thu, 22 Feb 2024 10:21:11 +1100 David Gibson wrote: > udp_timer_one() first checks for expiries of various sorts of sockets and > if necessary sets the 'sockp' variable to trigger a cleanup at the end. > If sockp is *not* set then, correctly, we don't attempt to close a > non-existent socket. However, we also don't clear the flag in the > udp_act[] map, in which case we'll come back here and there will, again, be > nothing to be done. Well, but that's intended: if we didn't reach UDP_CONN_TIMEOUT for this port, the socket should still be in udp_act[], meaning we'll check it against activity timeouts and close on timeout. Otherwise, we'll never check that port for the activity timeout, right? > So, clear the udp_act[] flag, even if we don't need to clean up a socket. > > Signed-off-by: David Gibson > --- > udp.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/udp.c b/udp.c > index 03a5936e..4200f849 100644 > --- a/udp.c > +++ b/udp.c > @@ -1123,8 +1123,9 @@ static void udp_timer_one(struct ctx *c, int v6, enum udp_act_type type, > *sockp = -1; > epoll_ctl(c->epollfd, EPOLL_CTL_DEL, s, NULL); > close(s); > - bitmap_clear(udp_act[v6 ? V6 : V4][type], port); > } > + > + bitmap_clear(udp_act[v6 ? V6 : V4][type], port); > } > > /** -- Stefano