incorrect separator for multiple ARP IP targets

Bug #1829264 reported by Mathieu Trudel-Lapierre
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Netplan
Fix Released
Undecided
Unassigned
netplan.io (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned
Disco
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
Users of netplan who need to configure multiple values for ARP IP targets.

[Test case]
Write a valid configuration for a bond with multiple ARP IP targets:

network:
  version: 2
  renderer: networkd
  bond:
    bd0:
      [...]
      parameters:
        arp-ip-targets: [ 192.168.3.56, 192.168.3.59 ]

Verify that the configuration is sucessfully applied, and shows up in the /sys filesystem for the affected device:

 /sys/class/net/bd0/bonding/arp_ip_targets

[Regression potential]
This affects only this particular value and generating a valid configuration file for the networkd renderer. The existing configuration file generation is /invalid/, but working as the bad value is ignored by systemd-networkd. This changes the generation of the configuration file only, to write the proper sequence of values for ARPIPTargets=.

---

https://github.com/CanonicalLtd/netplan/blob/ea47bd4e1c5319b1a624ea61c843ee96e7c128da/src/networkd.c#L208

The separator used to add multiple ARP IP targets for the networkd renderer is ",".

Unfortunately, networkd doesn't allow that, but rather expects whitespace:

(in config_parse_arp_ip_target_address():)
[...]
        for (;;) {
                [...]
                r = extract_first_word(&rvalue, &n, NULL, 0);

extract_first_word's third parameter is const char *separators; where NULL is handled like so (src/basic/extract-word.c:37):

        if (!separators)
                separators = WHITESPACE;

Finally:

src/basic/string-util.h:#define WHITESPACE " \t\n\r"

So; it doesn't handle commas for the list, just whitespace; so let's give it whitespace please :)

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in netplan.io (Ubuntu):
status: New → Confirmed
Revision history for this message
Ryan Harper (raharper) wrote :
Changed in netplan:
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package netplan.io - 0.98-0ubuntu1

---------------
netplan.io (0.98-0ubuntu1) eoan; urgency=medium

  * New upstream release: 0.98 (LP: #1840832)
    - Added new "feature flags" to identify new features
    - Added support for "use-domains" for DHCP overrides
    - Added support for setting IPv6 MTU Bytes (LP: #1671951)
    - Added a DBus interface to query and run 'netplan apply' via other apps
    - Various build system fixes
    - Improved validation for bonding modes
    - Added support for "hash:" for hashed 802.1x passwords (LP: #1819831)
    - Tolerate devices without a /sys path (LP: #1810043)
    - Fix incorrect separator for networkd with ARP IP targets (LP: #1829264)
  * debian/control: Add Build-Depends on libsystemd-dev for DBus feature, and
    on dbus-x11 for dbus-launch used in tests.

 -- Mathieu Trudel-Lapierre <email address hidden> Wed, 21 Aug 2019 14:49:16 -0400

Changed in netplan.io (Ubuntu):
status: Confirmed → Fix Released
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Mathieu, or anyone else affected,

Accepted netplan.io into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/netplan.io/0.98-0ubuntu1~18.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in netplan.io (Ubuntu Bionic):
status: New → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Verification-done on bionic:

ubuntu@ubuntu-XPS-15-9570:~$ lsb_release -cs
bionic
ubuntu@ubuntu-XPS-15-9570:/sys/class/net/bond0/bonding$ dpkg -l netplan.io | grep ii
ii netplan.io 0.98-0ubuntu1~18.04.1 amd64 YAML network configuration abstraction for various backend
ubuntu@ubuntu-XPS-15-9570:~$ cat /etc/netplan/01-network-manager-all.yaml
# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: networkd
  wifis:
    wlp59s0:
      access-points:
        cyphermox-secure:
          auth:
            [REDACTED]
      #dhcp4: yes
  bonds:
    bond0:
      interfaces: [ wlp59s0 ]
      dhcp4: yes
      parameters:
        arp-ip-targets: [ 10.3.0.1, 10.3.1.155 ]
        arp-interval: 2s
        mode: active-backup
ubuntu@ubuntu-XPS-15-9570:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: wlp59s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc noqueue master bond0 state UP group default qlen 1000
    link/ether d2:52:7d:ad:79:49 brd ff:ff:ff:ff:ff:ff
4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether d2:52:7d:ad:79:49 brd ff:ff:ff:ff:ff:ff
    inet 10.3.1.244/22 brd 10.3.3.255 scope global dynamic bond0
       valid_lft 14346sec preferred_lft 14346sec
    inet6 fe80::d052:7dff:fead:7949/64 scope link
       valid_lft forever preferred_lft forever
ubuntu@ubuntu-XPS-15-9570:~$ cd /sys/class/net/bond0/bonding/
ubuntu@ubuntu-XPS-15-9570:/sys/class/net/bond0/bonding$ cat mode
active-backup 1
ubuntu@ubuntu-XPS-15-9570:/sys/class/net/bond0/bonding$ cat arp_interval
2000
ubuntu@ubuntu-XPS-15-9570:/sys/class/net/bond0/bonding$ cat arp_ip_target
10.3.1.155 10.3.0.1

tags: added: verification-done-bionic
removed: verification-needed-bionic
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Verification-done for disco:

ubuntu@oddish:~$ lsb_release -cs
disco
ubuntu@oddish:~$ dpkg -l netplan.io | grep ii
ii netplan.io 0.98-0ubuntu1~19.04.1 amd64 YAML network configuration abstraction for various backends
ubuntu@oddish:~$ cat /etc/netplan/01-network-manager-all.yaml
network:
  version: 2
  renderer: networkd
  wifis:
    wlp58s0:
      access-points:
        cyphermox-secure:
          auth:
            [REDACTED\]
      #dhcp4: yes
  bonds:
    bond0:
      interfaces: [ wlp58s0 ]
      dhcp4: yes
      parameters:
        arp-ip-targets: [ 10.3.0.1, 10.3.1.155 ]
        arp-interval: 2s
        mode: active-backup
ubuntu@oddish:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: wlp58s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
    link/ether fa:a1:43:45:b8:0f brd ff:ff:ff:ff:ff:ff
3: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether fa:a1:43:45:b8:0f brd ff:ff:ff:ff:ff:ff
    inet 10.3.1.245/22 brd 10.3.3.255 scope global dynamic bond0
       valid_lft 14355sec preferred_lft 14355sec
    inet6 fe80::f8a1:43ff:fe45:b80f/64 scope link
       valid_lft forever preferred_lft forever
ubuntu@oddish:~$ cd /sys/class/net/bond0/bonding/
ubuntu@oddish:/sys/class/net/bond0/bonding$ cat mode
active-backup 1
ubuntu@oddish:/sys/class/net/bond0/bonding$ cat arp_interval
2000
ubuntu@oddish:/sys/class/net/bond0/bonding$ cat arp_ip_target
10.3.1.155 10.3.0.1

tags: added: verification-done-disco
removed: verification-needed
Changed in netplan.io (Ubuntu Disco):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package netplan.io - 0.98-0ubuntu1~19.04.1

---------------
netplan.io (0.98-0ubuntu1~19.04.1) disco; urgency=medium

  * Backport netplan.io 0.98 to 19.04. (LP: #1840832)

 -- Mathieu Trudel-Lapierre <email address hidden> Mon, 26 Aug 2019 16:41:36 -0400

Changed in netplan.io (Ubuntu Disco):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package netplan.io - 0.98-0ubuntu1~18.04.1

---------------
netplan.io (0.98-0ubuntu1~18.04.1) bionic; urgency=medium

  * Backport netplan.io 0.98 to 18.04. (LP: #1840832)
  * Keep patches specific to 18.04 support:
    - disable-networkd-tunnels-ipip-gre.patch: disable tests for unsupported
      tunnel types (ipip and gre) in the 18.04 version of systemd-networkd.
  * Drop debian/patches/glib_changes.patch: No longer necessary, changes were
    made upstream to better account for the changes in HashTable.
  * debian/netplan.io.install: add /usr/share/dbus-1

netplan.io (0.98-0ubuntu1) eoan; urgency=medium

  * New upstream release: 0.98 (LP: #1840832)
    - Added new "feature flags" to identify new features
    - Added support for "use-domains" for DHCP overrides
    - Added support for setting IPv6 MTU Bytes (LP: #1671951)
    - Added a DBus interface to query and run 'netplan apply' via other apps
    - Various build system fixes
    - Improved validation for bonding modes
    - Added support for "hash:" for hashed 802.1x passwords (LP: #1819831)
    - Tolerate devices without a /sys path (LP: #1810043)
    - Fix incorrect separator for networkd with ARP IP targets (LP: #1829264)
  * debian/control: Add Build-Depends on libsystemd-dev for DBus feature, and
    on dbus-x11 for dbus-launch used in tests.

 -- Mathieu Trudel-Lapierre <email address hidden> Mon, 26 Aug 2019 16:36:03 -0400

Changed in netplan.io (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for netplan.io has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Lukas Märdian (slyon)
Changed in netplan:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.