diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-08-25 14:01:48 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-08-25 14:01:48 +0000 |
commit | 37baeac93cdde3a5c38092d30df6a574c7e30b75 (patch) | |
tree | da923bddd3cd7fc9543d145672f6253fecfe11df /avahi-daemon/dbus-protocol.c | |
parent | fcce6a98913e8e949e3c9f6165080a036e9349cb (diff) |
* support GetNetworkInterfaceNameByIndex/IndexByName on IPv6-only hosts
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@442 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-daemon/dbus-protocol.c')
-rw-r--r-- | avahi-daemon/dbus-protocol.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c index 8a0bd55..b7965a3 100644 --- a/avahi-daemon/dbus-protocol.c +++ b/avahi-daemon/dbus-protocol.c @@ -1550,10 +1550,11 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void #else if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { - char txt[256]; - snprintf(txt, sizeof(txt), "OS Error: %s", strerror(errno)); - return respond_error(c, m, AVAHI_ERR_OS, txt); - } + if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { + char txt[256]; + snprintf(txt, sizeof(txt), "OS Error: %s", strerror(errno)); + return respond_error(c, m, AVAHI_ERR_OS, txt); + } memset(&ifr, 0, sizeof(ifr)); ifr.ifr_ifindex = idx; @@ -1584,10 +1585,11 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void return respond_int32(c, m, 1); #else if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { - char txt[256]; - snprintf(txt, sizeof(txt), "OS Error: %s", strerror(errno)); - return respond_error(c, m, AVAHI_ERR_OS, txt); - } + if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { + char txt[256]; + snprintf(txt, sizeof(txt), "OS Error: %s", strerror(errno)); + return respond_error(c, m, AVAHI_ERR_OS, txt); + } memset(&ifr, 0, sizeof(ifr)); snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s", n); |