From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 2BTeERWHumT0MAAASxT56A (envelope-from ) for ; Fri, 21 Jul 2023 15:24:37 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id kLBJERWHumTSbgAAauVa8A (envelope-from ) for ; Fri, 21 Jul 2023 15:24:37 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B78DD492C1 for ; Fri, 21 Jul 2023 15:24:36 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1689945877; h=from:from:sender:sender: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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=dPz57lcEZQtDooeM8QszgCie4krVMsme8RW/JTRVONs=; b=XEzMmbvpNRXo6Fjv4ulQLuajVzgp0EJAdDzRoqq5KLoY4WDlGmWl6SCCQu/oW3coWXZ+mi Rr9bNG2ekwyD/qgwlGCNyzd242rc4MnF7Jlap8b7MQGPWczEwdgnwN0k4Z8GfuR6eBsWSC KIRBrdvpYosYOmsVb026yG1MlDPWR/wVJ+vzo80yr8WrOSF3j1i91KqBE2jkc3ldPC1Udb lxuSZn+6/y/3I1gxJYVWPH8K3vUSNO4bC3utFBG9FBE/UTJl8B4gGDBa4TJbEE7XA9+Z14 fRNSvuxKhEbMFXnM3/Ssf5l+sryUM9iqH+pL/i4WeIE9yO44NYH6PhyeNSzRpg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1689945877; a=rsa-sha256; cv=none; b=Al4MfABU/nvbzNlC2lnTSKXUQ4nn2GZ8ZHKw0IIz6iUDrqYfqO7IOXTWfO4CNjZODbjS30 6R4Fr6TX7ZZerxRnWYk3XkwoZJDEegWydyd4OIYsE5gw3N7w4MKcj5mSF7nPgdfUonZFDL hyJmhSqkkw/pdxes/3Y1rGs/dbEkaeVcEav0AZuK4gb20AMEH1sVNtW7m9n56D27PROieX zt0H79yfYAQd3Yn7RjBVdW6g3UchLhKf0Jc7hNlrbAQCeYb2CQrWWjKQQCPYdoVXVLF0CQ UaRSXv4svnDjycVvRv1bJYOR7v34Y9vtS9ckXjPiX6YIFP1Lsjhab2vWcQalDw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMq75-00062V-8Z; Fri, 21 Jul 2023 09:24:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMq71-000623-7R for guix-patches@gnu.org; Fri, 21 Jul 2023 09:24:03 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qMq70-0006BI-KK for guix-patches@gnu.org; Fri, 21 Jul 2023 09:24:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qMq6z-0001Ka-Rk for guix-patches@gnu.org; Fri, 21 Jul 2023 09:24:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63402] [PATCH v5 2/5] services: wireguard: Implement a dynamic IP monitoring feature. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 21 Jul 2023 13:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63402 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 63402@debbugs.gnu.org Received: via spool by 63402-submit@debbugs.gnu.org id=B63402.16899458385107 (code B ref 63402); Fri, 21 Jul 2023 13:24:01 +0000 Received: (at 63402) by debbugs.gnu.org; 21 Jul 2023 13:23:58 +0000 Received: from localhost ([127.0.0.1]:60923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMq6w-0001KI-9v for submit@debbugs.gnu.org; Fri, 21 Jul 2023 09:23:58 -0400 Received: from smtpmciv4.myservices.hosting ([185.26.107.240]:37036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMq6s-0001K8-P6 for 63402@debbugs.gnu.org; Fri, 21 Jul 2023 09:23:56 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv4.myservices.hosting (Postfix) with ESMTP id 8C0CE20791; Fri, 21 Jul 2023 15:23:53 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 00F728009F; Fri, 21 Jul 2023 15:23:53 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id zujQewaTwKLv; Fri, 21 Jul 2023 15:23:52 +0200 (CEST) Received: from [192.168.1.116] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 68F9E8009E; Fri, 21 Jul 2023 15:23:52 +0200 (CEST) Message-ID: Date: Fri, 21 Jul 2023 14:23:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Content-Language: en-US References: <87o7k5kjfd.fsf@gmail.com> From: Bruno Victal In-Reply-To: <87o7k5kjfd.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx2.migadu.com X-Migadu-Spam-Score: -4.64 X-Spam-Score: -4.64 X-Migadu-Queue-Id: B78DD492C1 X-TUID: Xs31sv72Kb7C Hi Maxim, On 2023-07-21 04:55, Maxim Cournoyer wrote: > > Bruno Victal writes: > >> On 2023-05-19 02:59, Maxim Cournoyer wrote: > >>> +(define (host-name? name) >>> + "Predicate to check whether NAME is a host name, i.e. not an IP address." >>> + (not (or (ipv6-address? name) (ipv4-address? name)))) >> >> I'd craft an artificial uri string and extract this information from a uri >> record instead, since the above check is likely to reveal insufficient: >> >> scheme@(guile-user)> (use-modules (web uri)) >> scheme@(guile-user)> (define s "example.tld:9999") >> scheme@(guile-user)> (uri-host (string->uri (string-append "dummy://" s))) >> $5 = "example.tld" >> scheme@(guile-user)> (define s "[2001:db8::1234]:9999") >> scheme@(guile-user)> (uri-host (string->uri (string-append "dummy://" s))) >> $6 = "2001:db8::1234" > > I'm not sure I understand; In the second case, I'd like it to tell me > it's *not* a host name, but it seems like uri-host happily returns IP > addresses the same as host names? Right, I've reread the context of this more carefully and I must have been under the impression that this was being used to extract the address part of a "
:" string. You can disregard this. >>> +(define endpoint-host-names >>> + (@@ (gnu services vpn) endpoint-host-names)) >>> + >>> +(test-begin "vpn-services") >>> + >>> +(test-assert "ipv4-address?" >>> + (every ipv4-address? >>> + (list "192.95.5.67:1234" >>> + "10.0.0.1"))) >>> + >>> +(test-assert "ipv6-address?" >>> + (every ipv6-address? >>> + (list "[2607:5300:60:6b0::c05f:543]:2468" >>> + "2607:5300:60:6b0::c05f:543" >>> + "2345:0425:2CA1:0000:0000:0567:5673:23b5" >>> + "2345:0425:2CA1::0567:5673:23b5"))) >> >> Are these addresses special? >> If not, I'd recommend (properly) generating a random ULA prefix >> and use it instead. > > They are not! I derived them from actual IP addresses, adding some > fuzz. I've now used unique local IPv6 prefixes. Actually since these are only used for testing your predicate procedure it might be better to use the 2001:db8::/32 reserved prefix instead if I'm interpreting RFC3849 correctly. -- Furthermore, I consider that nonfree software must be eradicated. Cheers, Bruno.