summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-rtnl/test-rtnl.c
diff options
context:
space:
mode:
authorUmut Tezduyar Lindskog <umut.tezduyar@axis.com>2014-04-02 21:31:12 +0200
committerTom Gundersen <teg@jklm.no>2014-04-03 16:00:25 +0200
commitaba496a58acf9d9c61314de71353550e579f85ee (patch)
treee554123004bba327c3114539142047d4c124f40a /src/libsystemd/sd-rtnl/test-rtnl.c
parent3e790eae01ce74f94a5233adeab12c64508916e0 (diff)
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.
Diffstat (limited to 'src/libsystemd/sd-rtnl/test-rtnl.c')
-rw-r--r--src/libsystemd/sd-rtnl/test-rtnl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libsystemd/sd-rtnl/test-rtnl.c b/src/libsystemd/sd-rtnl/test-rtnl.c
index 44369628f4..529231a70a 100644
--- a/src/libsystemd/sd-rtnl/test-rtnl.c
+++ b/src/libsystemd/sd-rtnl/test-rtnl.c
@@ -106,6 +106,7 @@ static void test_address_get(sd_rtnl *rtnl, int ifindex) {
sd_rtnl_message *m;
sd_rtnl_message *r;
struct in_addr in_data;
+ struct ifa_cacheinfo cache;
char *label;
assert_se(sd_rtnl_message_new_addr(rtnl, &m, RTM_GETADDR, ifindex, AF_INET) >= 0);
@@ -116,6 +117,7 @@ static void test_address_get(sd_rtnl *rtnl, int ifindex) {
assert_se(sd_rtnl_message_read_in_addr(r, IFA_LOCAL, &in_data) == 0);
assert_se(sd_rtnl_message_read_in_addr(r, IFA_ADDRESS, &in_data) == 0);
assert_se(sd_rtnl_message_read_string(r, IFA_LABEL, &label) == 0);
+ assert_se(sd_rtnl_message_read_cache_info(r, IFA_CACHEINFO, &cache) == 0);
assert_se(sd_rtnl_flush(rtnl) >= 0);
assert_se((m = sd_rtnl_message_unref(m)) == NULL);