mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-22 13:33:56 +03:00
networkd: expose DHCPServer interface on links
This commit is contained in:
parent
38ee31a6e4
commit
cf72a78660
@ -760,6 +760,9 @@ int link_object_find(sd_bus *bus, const char *path, const char *interface, void
|
||||
if (r < 0)
|
||||
return 0;
|
||||
|
||||
if (streq(interface, "org.freedesktop.network1.DHCPServer") && !link->dhcp_server)
|
||||
return 0;
|
||||
|
||||
*found = link;
|
||||
|
||||
return 1;
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "local-addresses.h"
|
||||
#include "netlink-util.h"
|
||||
#include "network-internal.h"
|
||||
#include "networkd-dhcp-server-bus.h"
|
||||
#include "networkd-dhcp6.h"
|
||||
#include "networkd-link-bus.h"
|
||||
#include "networkd-manager-bus.h"
|
||||
@ -154,6 +155,10 @@ int manager_connect_bus(Manager *m) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to add link object vtable: %m");
|
||||
|
||||
r = sd_bus_add_fallback_vtable(m->bus, NULL, "/org/freedesktop/network1/link", "org.freedesktop.network1.DHCPServer", dhcp_server_vtable, link_object_find, m);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to add link object vtable: %m");
|
||||
|
||||
r = sd_bus_add_node_enumerator(m->bus, NULL, "/org/freedesktop/network1/link", link_node_enumerator, m);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to add link enumerator: %m");
|
||||
|
Loading…
Reference in New Issue
Block a user