summaryrefslogtreecommitdiff
path: root/src/libsystemd-network
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-06-29 13:11:44 +0200
committerTom Gundersen <teg@jklm.no>2014-06-29 15:18:21 +0200
commit7c16313f11e3953f3fe4dbf544f2d36f58d14138 (patch)
tree4c0b33320d2414eac78a58e06960a5321aa58833 /src/libsystemd-network
parent8e5edf8d42d3c441e4b09aa1dbbaf2cb605c1328 (diff)
networkd/sd-dhcp-server: only start dhcp server when necessary
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r--src/libsystemd-network/sd-dhcp-server.c6
1 files changed, 6 insertions, 0 deletions
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);