all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bruno Victal <mirai@makinata.eu>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: 63402@debbugs.gnu.org
Subject: [bug#63402] [PATCH v5 2/5] services: wireguard: Implement a dynamic IP monitoring feature.
Date: Fri, 21 Jul 2023 14:23:44 +0100	[thread overview]
Message-ID: <f3fea02d-6d12-0785-32b3-0c978d2eb67f@makinata.eu> (raw)
In-Reply-To: <87o7k5kjfd.fsf@gmail.com>

Hi Maxim,

On 2023-07-21 04:55, Maxim Cournoyer wrote:
> 
> Bruno Victal <mirai@makinata.eu> 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 "<ADDRESS>:<PORT>" 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.




  reply	other threads:[~2023-07-21 13:24 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-10  1:08 [bug#63402] [PATCH 0/1] Add a dynamic IP monitoring option to Wireguard service Maxim Cournoyer
2023-05-10  1:09 ` [bug#63403] [PATCH 1/1] services: wireguard: Implement a dynamic IP monitoring feature Maxim Cournoyer
2023-05-15 15:57   ` Maxim Cournoyer
2023-05-15 16:13 ` [bug#63402] [PATCH v2] " Maxim Cournoyer
2023-05-16  4:09 ` [bug#63402] [PATCH v3 1/3] " Maxim Cournoyer
2023-05-16  4:09   ` [bug#63402] [PATCH v3 2/3] services: wireguard: Clean-up configuration file serializer Maxim Cournoyer
2023-05-16  4:09   ` [bug#63402] [PATCH v3 3/3] services: wireguard: Workaround keep-alives bug Maxim Cournoyer
2023-05-18 17:48 ` [bug#63402] [PATCH v4 0/4] Implement a dynamic IP monitoring feature Maxim Cournoyer
2023-05-18 17:48   ` [bug#63402] [PATCH v4 1/4] services: wireguard: " Maxim Cournoyer
2023-05-18 17:48   ` [bug#63402] [PATCH v4 2/4] services: wireguard: Clean-up configuration file serializer Maxim Cournoyer
2023-05-18 17:48   ` [bug#63402] [PATCH v4 3/4] services: wireguard: Add a 'configuration' action Maxim Cournoyer
2023-05-18 17:48   ` [bug#63402] [PATCH v4 4/4] gnu: linux-libre: Apply wireguard patch fixing keep-alive bug Maxim Cournoyer
2023-05-19  1:59 ` [bug#63402] [PATCH v5 0/5] Implement a dynamic IP monitoring feature Maxim Cournoyer
2023-05-19  1:59   ` [bug#63402] [PATCH v5 1/5] services: herd: Add a new 'current-service' procedure Maxim Cournoyer
2023-05-22 15:00     ` [bug#63403] [PATCH 1/1] services: wireguard: Implement a dynamic IP monitoring feature Ludovic Courtès
2023-05-22 23:22       ` [bug#63402] bug#63403: " Maxim Cournoyer
2023-05-24 14:44         ` [bug#63403] " Ludovic Courtès
2023-07-21  2:15           ` Maxim Cournoyer
2023-05-19  1:59   ` [bug#63402] [PATCH v5 2/5] " Maxim Cournoyer
2023-05-22 15:03     ` [bug#63402] bug#63403: [PATCH 1/1] " Ludovic Courtès
2023-05-22 23:32       ` Maxim Cournoyer
2023-05-24 14:53         ` [bug#63403] " Ludovic Courtès
2023-05-24 22:12           ` Bruno Victal
2023-05-25 15:13           ` Maxim Cournoyer
2023-05-24 17:25     ` [bug#63402] [PATCH v5 2/5] " Bruno Victal
2023-07-21  3:55       ` Maxim Cournoyer
2023-07-21 13:23         ` Bruno Victal [this message]
2023-07-21 15:56           ` Maxim Cournoyer
2023-07-21 16:18           ` bug#63402: " Maxim Cournoyer
2023-05-19  1:59   ` [bug#63402] [PATCH v5 3/5] services: wireguard: Clean-up configuration file serializer Maxim Cournoyer
2023-05-19  1:59   ` [bug#63402] [PATCH v5 4/5] services: wireguard: Add a 'configuration' action Maxim Cournoyer
2023-05-19  1:59   ` [bug#63402] [PATCH v5 5/5] gnu: linux-libre: Apply wireguard patch fixing keep-alive bug Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f3fea02d-6d12-0785-32b3-0c978d2eb67f@makinata.eu \
    --to=mirai@makinata.eu \
    --cc=63402@debbugs.gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.