unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#52520: Multicast is off by default
@ 2021-12-15 19:36 Mathieu Othacehe
  2021-12-17 15:15 ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Mathieu Othacehe @ 2021-12-15 19:36 UTC (permalink / raw)
  To: 52520


Hello,

Since the guile-netlink switch the static IP interfaces no longer have
multicast support. This can be confirmed this way:

--8<---------------cut here---------------start------------->8---
4: eno4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether b0:26:28:b7:9d:09 brd ff:ff:ff:ff:ff:ff
5: eno2: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether b0:26:28:b7:9d:0b brd ff:ff:ff:ff:ff:ff
    inet 141.80.181.40/24 brd 141.80.181.255 scope global eno2
       valid_lft forever preferred_lft forever
    inet6 fe80::b226:28ff:feb7:9d0b/64 scope link 
       valid_lft forever preferred_lft forever
--8<---------------cut here---------------end--------------->8---

eno2 that is managed by the static-networking service is lacking
multicast support, while eno4 that is not managed by this service has
multicast support.

This can be adjusted by running:

--8<---------------cut here---------------start------------->8---
ip link set multicast on eno1
--8<---------------cut here---------------end--------------->8---

which immediately fixes Avahi discovery that depends on it.

I think that we could maybe apply the following patch, even though I
didn't test it.

--8<---------------cut here---------------start------------->8---
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 5f93483dda..af3fe015b9 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -2546,6 +2546,7 @@ (define network-set-up/linux
                                                 #$(network-address-ipv6? address))
                                       ;; FIXME: loopback?
                                       (link-set #$(network-address-device address)
+                                                #:multicast-on #t
                                                 #:up #t)))
                                 addresses)
--8<---------------cut here---------------end--------------->8---

Thanks,

Mathieu




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#52520: Multicast is off by default
  2021-12-15 19:36 bug#52520: Multicast is off by default Mathieu Othacehe
@ 2021-12-17 15:15 ` Ludovic Courtès
  2021-12-19 11:08   ` Mathieu Othacehe
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2021-12-17 15:15 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 52520

Hi,

Mathieu Othacehe <othacehe@gnu.org> skribis:

> Since the guile-netlink switch the static IP interfaces no longer have
> multicast support. This can be confirmed this way:

[...]

> I think that we could maybe apply the following patch, even though I
> didn't test it.
>
> diff --git a/gnu/services/base.scm b/gnu/services/base.scm
> index 5f93483dda..af3fe015b9 100644
> --- a/gnu/services/base.scm
> +++ b/gnu/services/base.scm
> @@ -2546,6 +2546,7 @@ (define network-set-up/linux
>                                                  #$(network-address-ipv6? address))
>                                        ;; FIXME: loopback?
>                                        (link-set #$(network-address-device address)
> +                                                #:multicast-on #t
>                                                  #:up #t)))

Is it #:multicast-on or #:allmulticast-on ?

Anyhow, I suggest adding a ‘multicast?’ field to <network-address>, with
#t as its default value, and honoring this.

(Someone told me they’d like to set the MTU, so we may need an ‘mtu’
field as well eventually.)

Thanks!

Ludo’.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#52520: Multicast is off by default
  2021-12-17 15:15 ` Ludovic Courtès
@ 2021-12-19 11:08   ` Mathieu Othacehe
  2021-12-20 15:29     ` Maxim Cournoyer
       [not found]     ` <87h7b3jt8i.fsf@gnu.org>
  0 siblings, 2 replies; 7+ messages in thread
From: Mathieu Othacehe @ 2021-12-19 11:08 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 52520


Hey,

> Is it #:multicast-on or #:allmulticast-on ?

The "ip link set multicast ..." command corresponds to the the
IFF_MULTICAST flag hence to the #:multicast-on parameter.

> Anyhow, I suggest adding a ‘multicast?’ field to <network-address>, with
> #t as its default value, and honoring this.

I'm not sure <network-address> is the right place for this flag. If
there are two <network-address> records in the same list, one for ipv4
and one for ipv6 it means that we need to repeat this flag twice.

Same for the MTU, having different MTU for ipv4 and ipv6 addresses
doesn't have any meaning. The MTU and multicast properties belong to the
device itself.

I think we should introduce a <network-device> record that would gather
the properties that can be passed to the "link-set" method of
Guile-Netlink. The <static-networking> record would point to a unique
<network-device>. We would remove the device field from
<network-address>.

Then each <static-networking> service would provision (concat
'networking- (network-device-name device)) or something like that, to fix
https://issues.guix.gnu.org/52511 as well.

How does that sounds?

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#52520: Multicast is off by default
  2021-12-19 11:08   ` Mathieu Othacehe
@ 2021-12-20 15:29     ` Maxim Cournoyer
       [not found]     ` <87h7b3jt8i.fsf@gnu.org>
  1 sibling, 0 replies; 7+ messages in thread
From: Maxim Cournoyer @ 2021-12-20 15:29 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 52520

Hello,

Mathieu Othacehe <othacehe@gnu.org> writes:

> Hey,
>
>> Is it #:multicast-on or #:allmulticast-on ?
>
> The "ip link set multicast ..." command corresponds to the the
> IFF_MULTICAST flag hence to the #:multicast-on parameter.
>
>> Anyhow, I suggest adding a ‘multicast?’ field to <network-address>, with
>> #t as its default value, and honoring this.
>
> I'm not sure <network-address> is the right place for this flag. If
> there are two <network-address> records in the same list, one for ipv4
> and one for ipv6 it means that we need to repeat this flag twice.
>
> Same for the MTU, having different MTU for ipv4 and ipv6 addresses
> doesn't have any meaning. The MTU and multicast properties belong to the
> device itself.
>
> I think we should introduce a <network-device> record that would gather
> the properties that can be passed to the "link-set" method of
> Guile-Netlink. The <static-networking> record would point to a unique
> <network-device>. We would remove the device field from
> <network-address>.
>
> Then each <static-networking> service would provision (concat
> 'networking- (network-device-name device)) or something like that, to fix
> https://issues.guix.gnu.org/52511 as well.
>
> How does that sounds?

Seems to have it on the network device would be less surprising, indeed
:-).  It makes sense to me.

Thank you,

Maxim




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#52520: Multicast is off by default
       [not found]     ` <87h7b3jt8i.fsf@gnu.org>
@ 2021-12-20 16:38       ` Mathieu Othacehe
  2021-12-20 21:33         ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Mathieu Othacehe @ 2021-12-20 16:38 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 52520


Hey,

> Can we instead use <network-link> for these purposes?  It is already
> there, just unused.

Mmh, indeed. Well it is already used to create vlan and veth
interfaces. What we could do then, is expose the <network-link> record
as a direct equivalent of the Guile-Netlink <link> record.

The links list of the <static-networking> record would contain all the
links that are managed by Guix. We would require all "device" fields
that appear in the <network-address> records to have their matching link
declared. If the link doesn't already exists (vlan, veth type) then
link-add is called, otherwise nothing happens. The link existence can be
tested using link-name->index. link-set would always be called
afterwards to setup link properties.

static-networking-shepherd-service would then create on service per link
present in the <static-networking> links list. The provisioned name
would be (concat 'networking- (network-link-name link)).

On tear down, which is equivalent to "herd stop networking-<link>", we
would call link-del if the link was created by Guix with link-add, or
(link-set ... #:down #t) if the link was already present. I'm not sure
how to distinguish between those two cases at this step.

This sounds like a complex plan, that will moreover require and
adaptation of existing static-networking configurations, but I cannot
think of anything easier to fix this issue and the other one I reported.

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#52520: Multicast is off by default
  2021-12-20 16:38       ` Mathieu Othacehe
@ 2021-12-20 21:33         ` Ludovic Courtès
  2021-12-21 19:40           ` Mathieu Othacehe
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2021-12-20 21:33 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 52520

Mathieu Othacehe <othacehe@gnu.org> skribis:

>> Can we instead use <network-link> for these purposes?  It is already
>> there, just unused.

BTW, for the purposes of fixing the bug you initially reported, I
suggest simply adding #:multicast-on #t as you initially proposed.
We discuss the proper API separately.

> Mmh, indeed. Well it is already used to create vlan and veth
> interfaces. What we could do then, is expose the <network-link> record
> as a direct equivalent of the Guile-Netlink <link> record.
>
> The links list of the <static-networking> record would contain all the
> links that are managed by Guix. We would require all "device" fields
> that appear in the <network-address> records to have their matching link
> declared. If the link doesn't already exists (vlan, veth type) then
> link-add is called, otherwise nothing happens. The link existence can be
> tested using link-name->index. link-set would always be called
> afterwards to setup link properties.
>
> static-networking-shepherd-service would then create on service per link
> present in the <static-networking> links list. The provisioned name
> would be (concat 'networking- (network-link-name link)).
>
> On tear down, which is equivalent to "herd stop networking-<link>", we
> would call link-del if the link was created by Guix with link-add, or
> (link-set ... #:down #t) if the link was already present. I'm not sure
> how to distinguish between those two cases at this step.
>
> This sounds like a complex plan, that will moreover require and
> adaptation of existing static-networking configurations, but I cannot
> think of anything easier to fix this issue and the other one I reported.

Hmm yeah.  I think it’s good to have defaults right, so #:up and
#:multicast-on set.  We could set those when a device lacks a
corresponding link.

Food for thought…

Ludo’.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#52520: Multicast is off by default
  2021-12-20 21:33         ` Ludovic Courtès
@ 2021-12-21 19:40           ` Mathieu Othacehe
  0 siblings, 0 replies; 7+ messages in thread
From: Mathieu Othacehe @ 2021-12-21 19:40 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 52520-done


Hey,

> BTW, for the purposes of fixing the bug you initially reported, I
> suggest simply adding #:multicast-on #t as you initially proposed.
> We discuss the proper API separately.

Done with: d2f9578a9f1249dfecb0a6b4cd06fd9641fcd1a9.

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-21 19:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-15 19:36 bug#52520: Multicast is off by default Mathieu Othacehe
2021-12-17 15:15 ` Ludovic Courtès
2021-12-19 11:08   ` Mathieu Othacehe
2021-12-20 15:29     ` Maxim Cournoyer
     [not found]     ` <87h7b3jt8i.fsf@gnu.org>
2021-12-20 16:38       ` Mathieu Othacehe
2021-12-20 21:33         ` Ludovic Courtès
2021-12-21 19:40           ` Mathieu Othacehe

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).