network: register callback for dhcp server (#18146)

Setting dhcp_server_callback is needed in order to get an event when dhcp
leases change.

The callback was introduced by 38ee31a6e4,
but never used.
master
Luka Kudra 2 years ago committed by GitHub
parent 4ad303fddd
commit a95e930685
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/network/networkd-dhcp-server.c

@ -10,6 +10,7 @@
#include "fileio.h"
#include "networkd-address.h"
#include "networkd-dhcp-server.h"
#include "networkd-dhcp-server-bus.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-network.h"
@ -271,6 +272,10 @@ int dhcp4_server_configure(Link *link) {
return r;
}
r = sd_dhcp_server_set_callback(link->dhcp_server, dhcp_server_callback, link);
if (r < 0)
return log_link_warning_errno(link, r, "Failed to set callback for DHCPv4 server instance: %m");
address = link_find_dhcp_server_address(link);
if (!address)
return log_link_error_errno(link, SYNTHETIC_ERRNO(EBUSY),

Loading…
Cancel
Save