[systemd-commits] 2 commits - src/libsystemd-network
Thomas H.P. Andersen
phomes at kemper.freedesktop.org
Sun Aug 3 11:43:06 PDT 2014
src/libsystemd-network/sd-dhcp-server.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit 621ac3d2cc8f37169166df9c7f379b0cb6b17e36
Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date: Sun Aug 3 19:45:20 2014 +0200
sd-dhcp-server: avoid returning garbage value
Force renewing with a pool size of 0 would return the uninitialized r.
diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c
index 2d3eaa3..50d9b7f 100644
--- a/src/libsystemd-network/sd-dhcp-server.c
+++ b/src/libsystemd-network/sd-dhcp-server.c
@@ -919,7 +919,7 @@ int sd_dhcp_server_start(sd_dhcp_server *server) {
int sd_dhcp_server_forcerenew(sd_dhcp_server *server) {
unsigned i;
- int r;
+ int r = 0;
assert_return(server, -EINVAL);
assert(server->bound_leases);
commit c15fb62a731f1a457af94e60ac6a4d23f219a8f6
Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date: Sun Aug 3 19:30:38 2014 +0200
sd-dhcp-server: check if r < 0
diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c
index 99b833a..2d3eaa3 100644
--- a/src/libsystemd-network/sd-dhcp-server.c
+++ b/src/libsystemd-network/sd-dhcp-server.c
@@ -485,6 +485,8 @@ static int server_send_forcerenew(sd_dhcp_server *server, be32_t address, be32_t
r = dhcp_server_send_udp(server, address, &packet->dhcp,
sizeof(DHCPMessage) + optoffset);
+ if (r < 0)
+ return r;
return 0;
}
More information about the systemd-commits
mailing list