From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4ZWQ1w6np5z3359 for ; Mon, 7 Apr 2025 10:10:12 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "R10" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4ZWQ1v6xR0z2y23 for ; Mon, 7 Apr 2025 10:10:11 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4ZWQ1v0YCRz36; Mon, 7 Apr 2025 10:10:11 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1744020611; 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=3q1gRER6YG8OI7n4LHvss+bgcF00Qy7mXMsCh93ed0k=; b=pbFomn9FKoFMYvFXM6GfUhVLIufKcCR1k8fhg7vyld4xxNzCqdVx5VDk5L34dTGGu/lLzj a04pXwm48QJf3kCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1744020611; 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=3q1gRER6YG8OI7n4LHvss+bgcF00Qy7mXMsCh93ed0k=; b=ibJ1+pLQ7wWhaUT1Q8CQnl9mvuWb9mmljl2Nrf0qIQNaSjtirvfAA7c97+MmgO98mqTup+ K0vC3WtInNv9BXpUjDGyQ5pYZNgIFnzS09w+8qbcQVxm3YlvZRmuHHTnevCbU6KhAHtc9C QzXP4CLE1nnAsst2kQtjY/32gHVD+HfucAooLL/l09ocNyi7IryAPOYPPap44+4cp4ZRhc bVQbbxk8TDeiYgFU/wpPiii0YM1yjs376aFE9yW4C3HTza2n55Ijt1DTkRMtPFXfGHfzJF 2YsELU4kUvvI2W7a5BAPLWpPc+OA4T697waZ1HXt7w82gCLo7GuC+kOD8S8bmA== Content-Type: text/plain; charset=utf-8 Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: Mime-Version: 1.0 Subject: Re: [PATCH] tests: Ensure loc_database_lookup finds a match From: Michael Tremer In-Reply-To: <20250407012929.19255-1-valter.jansons@gmail.com> Date: Mon, 7 Apr 2025 11:10:10 +0100 Cc: location@lists.ipfire.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20250407012929.19255-1-valter.jansons@gmail.com> To: Valters Jansons Hello Valters, Thank you for this patch. I have merged it. Indeed there should be no error returned, but the = result pointer should be NULL. That was a change in the API but it = should always have been like this. On all the architectures that we are now testing on Jenkins, this is = building just fine. I currently don=E2=80=99t build for hppa. -Michael > On 7 Apr 2025, at 02:29, Valters Jansons = wrote: >=20 > Commit 9e72b8a modified the lookup function to return 0 even if no > matches are found. As result, the test case could pass even if the > database lookup did not find any matches. >=20 > This commit restores the original intent of the test case, by adding > a failure condition when `network1` is NULL. This is similar to how > the subsequent test case was modified for the inverse condition. > --- > I was checking = https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D1021952 > and wondering why the "Could not look up 2001:db8::" issue would > suddenly disappear. This change popped up as a potential reason. > So I am expecting hppa builds will start failing intermittently again. >=20 > src/test-network.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/src/test-network.c b/src/test-network.c > index 0cac1a4..73062f4 100644 > --- a/src/test-network.c > +++ b/src/test-network.c > @@ -351,7 +351,7 @@ int main(int argc, char** argv) { >=20 > // Lookup an address in the subnet > err =3D loc_database_lookup_from_string(db, "2001:db8::", &network1); > - if (err) { > + if (err || !network1) { > fprintf(stderr, "Could not look up 2001:db8::\n"); > exit(EXIT_FAILURE); > } > --=20 > 2.49.0 >=20 >=20