From ecde90ac204a58ea86026a9f9b556a52ac15187f Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 13 Apr 2007 21:32:36 +0000 Subject: Bring up interfaces on servers --- network/server.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'network/server.c') diff --git a/network/server.c b/network/server.c index 2e6ae84c..aaa14b41 100644 --- a/network/server.c +++ b/network/server.c @@ -30,6 +30,8 @@ #include #include #include +#include +#include #include #include @@ -266,7 +268,8 @@ static void authorization_callback(DBusPendingCall *pcall, void *data) char devname[16]; DBusError derr; uint16_t response; - int sk; + int sk, sd; + struct ifreq ifr; if (!ns->pauth) { dbus_message_unref(reply); @@ -306,6 +309,13 @@ static void authorization_callback(DBusPendingCall *pcall, void *data) goto failed; } + sd = socket(AF_INET6, SOCK_DGRAM, 0); + strcpy(ifr.ifr_name, devname); + ifr.ifr_flags |= IFF_UP; + if((ioctl(sd, SIOCSIFFLAGS, (caddr_t)&ifr)) == -1) { + error("Could not bring up %d", devname); + } + /* FIXME: Enable routing if applied */ /* FIXME: send the D-Bus message to notify the new bnep iface */ -- cgit