summaryrefslogtreecommitdiff
path: root/src/network/networkd-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-manager.c')
-rw-r--r--src/network/networkd-manager.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index 90328a1b50..ca781e2bb4 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -54,6 +54,10 @@ int manager_new(Manager **ret) {
if (r < 0)
return r;
+ r = sd_bus_default_system(&m->bus);
+ if (r < 0)
+ return r;
+
m->udev = udev_new();
if (!m->udev)
return -ENOMEM;
@@ -85,6 +89,7 @@ void manager_free(Manager *m) {
udev_monitor_unref(m->udev_monitor);
udev_unref(m->udev);
+ sd_bus_unref(m->bus);
sd_event_source_unref(m->udev_event_source);
sd_event_unref(m->event);
@@ -280,6 +285,16 @@ int manager_rtnl_listen(Manager *m) {
return 0;
}
+int manager_bus_listen(Manager *m) {
+ int r;
+
+ r = sd_bus_attach_event(m->bus, m->event, 0);
+ if (r < 0)
+ return r;
+
+ return 0;
+}
+
static void append_dns(FILE *f, struct in_addr *dns, unsigned char family, unsigned *count) {
char buf[INET6_ADDRSTRLEN];
const char *address;