From 7c16313f11e3953f3fe4dbf544f2d36f58d14138 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Sun, 29 Jun 2014 13:11:44 +0200 Subject: networkd/sd-dhcp-server: only start dhcp server when necessary --- src/libsystemd-network/sd-dhcp-server.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/libsystemd-network') diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c index c932377d88..5c32fdfffa 100644 --- a/src/libsystemd-network/sd-dhcp-server.c +++ b/src/libsystemd-network/sd-dhcp-server.c @@ -62,6 +62,12 @@ int sd_dhcp_server_set_address(sd_dhcp_server *server, struct in_addr *address) return 0; } +bool sd_dhcp_server_is_running(sd_dhcp_server *server) { + assert_return(server, -EINVAL); + + return !!server->receive_message; +} + sd_dhcp_server *sd_dhcp_server_ref(sd_dhcp_server *server) { if (server) assert_se(REFCNT_INC(server->n_ref) >= 2); -- cgit v1.2.3-54-g00ecf