[systemd-commits] 3 commits - src/libsystemd src/network

Tom Gundersen tomegun at kemper.freedesktop.org
Wed Feb 19 16:48:04 CET 2014


 src/libsystemd/sd-rtnl/test-rtnl.c |    1 +
 src/network/networkd-link.c        |   13 ++++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 5723e1760f12867c697b93c7ffe82b708b10fa84
Author: Tom Gundersen <teg at jklm.no>
Date:   Wed Feb 19 16:40:52 2014 +0100

    sd-rtnl: test - include missing.h to build on old kernels

diff --git a/src/libsystemd/sd-rtnl/test-rtnl.c b/src/libsystemd/sd-rtnl/test-rtnl.c
index 7bbc448..5ab06d5 100644
--- a/src/libsystemd/sd-rtnl/test-rtnl.c
+++ b/src/libsystemd/sd-rtnl/test-rtnl.c
@@ -27,6 +27,7 @@
 #include "socket-util.h"
 #include "rtnl-util.h"
 #include "event-util.h"
+#include "missing.h"
 
 static void test_link_configure(sd_rtnl *rtnl, int ifindex) {
         _cleanup_rtnl_message_unref_ sd_rtnl_message *message;

commit 14efd7617b240f025791e428c1172f756318f78e
Author: Tom Gundersen <teg at jklm.no>
Date:   Wed Feb 19 16:34:34 2014 +0100

    networkd: dhcp - log when lease is lost

diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index aa23bfb..37bc5ab 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -479,6 +479,8 @@ static int dhcp_lease_lost(Link *link) {
         assert(link);
         assert(link->dhcp_lease);
 
+        log_warning_link(link, "DHCP lease lost");
+
         r = address_new_dynamic(&address);
         if (r >= 0) {
                 sd_dhcp_lease_get_address(link->dhcp_lease, &addr);

commit 216816c6bcabd70342593637a55300749a567f5c
Author: Tom Gundersen <teg at jklm.no>
Date:   Wed Feb 19 15:59:31 2014 +0100

    networkd: link - only reset transient hostname if it was set by us

diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 66bcb6b..aa23bfb 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -507,9 +507,14 @@ static int dhcp_lease_lost(Link *link) {
         }
 
         if (link->network->dhcp_hostname) {
-                r = set_hostname(link->manager->bus, "");
-                if (r < 0)
-                        log_error("Failed to reset transient hostname");
+                const char *hostname = NULL;
+
+                r = sd_dhcp_lease_get_hostname(link->dhcp_lease, &hostname);
+                if (r >= 0 && hostname) {
+                        r = set_hostname(link->manager->bus, "");
+                        if (r < 0)
+                                log_error("Failed to reset transient hostname");
+                }
         }
 
         link->dhcp_lease = sd_dhcp_lease_unref(link->dhcp_lease);



More information about the systemd-commits mailing list