summaryrefslogtreecommitdiff
path: root/src/network/networkd-manager.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-01-13 23:48:28 +0100
committerTom Gundersen <teg@jklm.no>2014-01-16 20:32:08 +0100
commit1346b1f0388f4100bb3c2a2bb23bc881769c020c (patch)
tree2e6aa6dc4d2a834156bb082408e9220018c039f6 /src/network/networkd-manager.c
parent6fc73498945da749744041d4e10cf8dfac5c3bc6 (diff)
sd-dhcp-client/networkd: add transient hostname support
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;