[Bug 1829264] Re: incorrect separator for multiple ARP IP targets
Brian Murray
brian at ubuntu.com
Wed Oct 2 21:47:29 UTC 2019
** Also affects: netplan.io (Ubuntu Disco)
Importance: Undecided
Status: New
** Changed in: netplan.io (Ubuntu Disco)
Status: New => Fix Committed
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to netplan.io in Ubuntu.
Matching subscriptions: foundations-bugs
https://bugs.launchpad.net/bugs/1829264
Title:
incorrect separator for multiple ARP IP targets
Status in netplan:
Fix Committed
Status in netplan.io package in Ubuntu:
Fix Released
Status in netplan.io source package in Bionic:
Fix Released
Status in netplan.io source package in Disco:
Fix Released
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 :)
To manage notifications about this bug go to:
https://bugs.launchpad.net/netplan/+bug/1829264/+subscriptions
More information about the foundations-bugs
mailing list