diff options
author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2007-04-13 21:49:21 +0000 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2007-04-13 21:49:21 +0000 |
commit | 4e12859a71297e7292c219eb9aea5ad00322c518 (patch) | |
tree | d2fc752eb06426dcd730b732f73f07c3f9a446cb /network/server.c | |
parent | 373808d7a4932c4b5a2616e09f0d8e7d45ccabbe (diff) |
Handle errors bringing up interfaces on servers
Diffstat (limited to 'network/server.c')
-rw-r--r-- | network/server.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/network/server.c b/network/server.c index aaa14b41..3134001c 100644 --- a/network/server.c +++ b/network/server.c @@ -268,7 +268,7 @@ static void authorization_callback(DBusPendingCall *pcall, void *data) char devname[16]; DBusError derr; uint16_t response; - int sk, sd; + int sk, sd, err; struct ifreq ifr; if (!ns->pauth) { @@ -312,8 +312,10 @@ static void authorization_callback(DBusPendingCall *pcall, void *data) 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); + if((ioctl(sd, SIOCSIFFLAGS, (caddr_t)&ifr)) < 0) { + err = errno; + error("Could not bring up %d. %s(%d)", devname, strerror(err), + err); } /* FIXME: Enable routing if applied */ |