[systemd-commits] 3 commits - src/libsystemd-network src/network
Tom Gundersen
tomegun at kemper.freedesktop.org
Sun Jun 29 08:01:37 PDT 2014
src/libsystemd-network/sd-dhcp-client.c | 2 +-
src/network/networkd-link.c | 14 +++++++++-----
2 files changed, 10 insertions(+), 6 deletions(-)
New commits:
commit 46ba9fbae2517e6fee2a2b486ef9f06a62284b8c
Author: Tom Gundersen <teg at jklm.no>
Date: Sun Jun 29 16:59:33 2014 +0200
networkd: dhcp - update the lifetime of an existing address
The logic otherwise is that we leave anything preconfigured alone, but in the case of DHCP
we actually need to update it whenever the lease is renewed.
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index dff445b..b597b16 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -760,7 +760,9 @@ static int link_enter_set_addresses(Link *link) {
address->prefixlen = prefixlen;
address->broadcast.s_addr = addr.s_addr | ~netmask.s_addr;
- r = address_configure(address, link, &address_handler);
+ /* use update rather than configure so that we will update the lifetime
+ of an existing address if it has already been configured */
+ r = address_update(address, link, &address_handler);
if (r < 0) {
log_warning_link(link,
"could not set addresses: %s", strerror(-r));
commit fb41e6d7c68c83558f8482f7fc72794a67b0638f
Author: Tom Gundersen <teg at jklm.no>
Date: Sun Jun 29 16:42:43 2014 +0200
sd-dhcp-client: don't fail hard if UDP socket can not be bound
Even if we cannot renew the lease at T1, we will likely succeed at T2, so warn and ignore the failure.
This could happen if for whatever reason the received address is not yet configured, or it has
been lost.
diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c
index 790728b..8e9f5bd 100644
--- a/src/libsystemd-network/sd-dhcp-client.c
+++ b/src/libsystemd-network/sd-dhcp-client.c
@@ -776,7 +776,7 @@ static int client_timeout_t1(sd_event_source *s, uint64_t usec,
r = dhcp_network_bind_udp_socket(client->lease->address,
DHCP_PORT_CLIENT);
if (r < 0) {
- client_stop(client, r);
+ log_dhcp_client(client, "could not bind UDP socket");
return 0;
}
commit b16665806a448186f432b47e944f1682284a0182
Author: Tom Gundersen <teg at jklm.no>
Date: Sun Jun 29 16:34:43 2014 +0200
networkd: improve DHCP error logging
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 4c75fa3..dff445b 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -413,7 +413,7 @@ static int link_set_dhcp_routes(Link *link) {
r = sd_dhcp_lease_get_routes(link->dhcp_lease, &static_routes, &static_routes_size);
if (r < 0) {
if (r != -ENOENT)
- log_warning_link(link, "DHCP error: %s", strerror(-r));
+ log_warning_link(link, "DHCP error: could not get routes: %s", strerror(-r));
return r;
}
@@ -519,7 +519,8 @@ static int link_enter_set_routes(Link *link) {
r = sd_dhcp_lease_get_router(link->dhcp_lease, &gateway);
if (r < 0 && r != -ENOENT) {
- log_warning_link(link, "DHCP error: %s", strerror(-r));
+ log_warning_link(link, "DHCP error: could not get gateway: %s",
+ strerror(-r));
return r;
}
@@ -1109,7 +1110,8 @@ static int dhcp_lease_acquired(sd_dhcp_client *client, Link *link) {
r = sd_dhcp_lease_get_router(lease, &gateway);
if (r < 0 && r != -ENOENT) {
- log_warning_link(link, "DHCP error: %s", strerror(-r));
+ log_warning_link(link, "DHCP error: could not get gateway: %s",
+ strerror(-r));
return r;
}
@@ -1250,7 +1252,7 @@ static void dhcp_handler(sd_dhcp_client *client, int event, void *userdata) {
break;
default:
if (event < 0)
- log_warning_link(link, "DHCP error: %s", strerror(-event));
+ log_warning_link(link, "DHCP error: client failed: %s", strerror(-event));
else
log_warning_link(link, "DHCP unknown event: %d", event);
break;
More information about the systemd-commits
mailing list