]> git.ipfire.org Git - thirdparty/systemd.git/commit
networkd: Wait for link to get carrier before setting addresses
authorRichard Maw <richard.maw@codethink.co.uk>
Wed, 7 Jun 2017 15:30:46 +0000 (16:30 +0100)
committerRichard Maw <richard.maw@codethink.co.uk>
Mon, 12 Jun 2017 15:39:24 +0000 (16:39 +0100)
commitc1835a427fddac41dcc780cf733b53e01721e8f2
tree7706a3ce8f59c87eb29a53ca51c7aaf6e1fe07e1
parent410a7f15f0c6a96cd3b6a73f4a6465a5abfb9d0a
networkd: Wait for link to get carrier before setting addresses

For containers the link is effectively always up,
but for virtual and physical machines networkd may have started
before the link has gained carrier.

Networkd will configure addresses when carrier is gained,
but should also configure addresses if the link is already up.
Without this patch the addresses are set unconditionally.

Normally this isn't a problem since addresses are either fixed,
set over DHCP, or is never without carrier.
But for machines that gain carrier and are configured to select
an address from the unallocated local address pool
this causes them to pick an address from the pool twice.

This change to skip address configuration when a link is added
before it has a carrier fixes having multiple addresses assigned
if the machine starts networkd before it has gained carrier
and is configured with an address from the pool.
src/network/networkd-link.c