From aba496a58acf9d9c61314de71353550e579f85ee Mon Sep 17 00:00:00 2001 From: Umut Tezduyar Lindskog Date: Wed, 2 Apr 2014 21:31:12 +0200 Subject: networkd: smooth transition from ipv4ll to dhcp address Currently when both ipv4ll and dhcp are enabled, ipv4ll address (if one has been claimed) is removed when dhcp address is aquired. This is not the best thing to do since there might be clients unaware of the removal trying to communicate. This patch provides a smooth transition between ipv4ll and dhcp. If ipv4ll address was claimed [1] before dhcp, address is marked as deprecated. Deprecated address is still a valid address and packets can be received on it but address cannot be selected as a source address. If dhcp lease cannot be extended, then ipv4ll address is marked as valid again. [1] If there is no collision, claiming IPv4LL takes between 4 to 7 seconds. --- src/libsystemd-network/sd-ipv4ll.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/libsystemd-network/sd-ipv4ll.c') diff --git a/src/libsystemd-network/sd-ipv4ll.c b/src/libsystemd-network/sd-ipv4ll.c index a201139b08..81fe85b68b 100644 --- a/src/libsystemd-network/sd-ipv4ll.c +++ b/src/libsystemd-network/sd-ipv4ll.c @@ -481,6 +481,12 @@ error: return r; } +bool sd_ipv4ll_is_running(sd_ipv4ll *ll) { + assert_return(ll, -EINVAL); + + return ll->state != IPV4LL_STATE_INIT; +} + #define HASH_KEY SD_ID128_MAKE(df,04,22,98,3f,ad,14,52,f9,87,2e,d1,9c,70,e2,f2) int sd_ipv4ll_start (sd_ipv4ll *ll) { -- cgit v1.2.3-54-g00ecf