diff options
| -rw-r--r-- | network/server.c | 12 | 
1 files changed, 11 insertions, 1 deletions
| 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 <stdlib.h>  #include <errno.h>  #include <sys/socket.h> +#include <sys/ioctl.h> +#include <net/if.h>  #include <bluetooth/bluetooth.h>  #include <bluetooth/bnep.h> @@ -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 */ | 
