From 5c1d3fc93d91384bbac29adf01074fa4375317ea Mon Sep 17 00:00:00 2001 From: Umut Tezduyar Lindskog Date: Fri, 28 Feb 2014 16:10:20 +0100 Subject: sd-network: IPv4 link-local support [v2] Implements IPv4LL with respect to RFC 3927 (http://tools.ietf.org/rfc/rfc3927.txt) and integrates it with networkd. Majority of the IPv4LL state machine is taken from avahi (http://avahi.org/) project's autoip. IPv4LL can be enabled by IPv4LL=yes under [Network] section of .network file. IPv4LL works independent of DHCP but if DHCP lease is aquired, then LL address will be dropped. [tomegun: removed a trailing newline and a compiler warning] --- src/network/networkd-address.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/network/networkd-address.c') diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index a63773928f..c92418967b 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -47,6 +47,7 @@ int address_new_static(Network *network, unsigned section, Address **ret) { return -ENOMEM; address->family = AF_UNSPEC; + address->scope = RT_SCOPE_UNIVERSE; address->network = network; @@ -71,6 +72,7 @@ int address_new_dynamic(Address **ret) { return -ENOMEM; address->family = AF_UNSPEC; + address->scope = RT_SCOPE_UNIVERSE; *ret = address; address = NULL; @@ -170,7 +172,7 @@ int address_configure(Address *address, Link *link, return r; } - r = sd_rtnl_message_addr_set_scope(req, RT_SCOPE_UNIVERSE); + r = sd_rtnl_message_addr_set_scope(req, address->scope); if (r < 0) { log_error("Could not set scope: %s", strerror(-r)); return r; -- cgit v1.2.3-54-g00ecf