Bug 83270

Summary: systemd-networkd: Multiple addresses are added in the reverse order
Product: systemd Reporter: Jonas Hahnfeld <hahnjo>
Component: generalAssignee: Tom Gundersen <teg>
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Jonas Hahnfeld 2014-08-30 12:27:33 UTC
Example: eth0.network

[Match]
Name=eth0

[Network]
Address=192.168.122.133/24
Address=192.168.122.233/24
Gateway=192.168.122.1
EOF

$ ip addr
[...]
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:cc:2e:59 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.233/24 brd 192.168.122.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.122.133/24 brd 192.168.122.255 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fecc:2e59/64 scope link 
       valid_lft forever preferred_lft forever

Looking at the code I see that static addresses are prepended to the list (networkd-address.c, line 62) and then looped over in networkd-link.c, line 551.

Is it a feature or a bug? It's pretty annoying for setting the default and the alias IP...
Comment 1 Zbigniew Jedrzejewski-Szmek 2015-01-12 04:59:14 UTC
Should be fixed by http://cgit.freedesktop.org/systemd/systemd/commit/?id=1e39ff926f.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.