From: bert hubert Date: Mon, 5 Jan 2015 11:46:50 +0000 (+0100) Subject: if we make an IPv6 address struct, make sure it has that family, and that the scope_i... X-Git-Tag: rec-3.7.0-rc1~67^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39d2d9b29075a363323264b3453ce6c17dd90a6c;p=thirdparty%2Fpdns.git if we make an IPv6 address struct, make sure it has that family, and that the scope_id is zeroed of not set explicitly --- diff --git a/pdns/misc.cc b/pdns/misc.cc index 7469119991..98cd866433 100644 --- a/pdns/misc.cc +++ b/pdns/misc.cc @@ -680,7 +680,9 @@ int makeIPv6sockaddr(const std::string& addr, struct sockaddr_in6* ret) ourAddr.assign(addr.c_str() + 1, pos-1); port = atoi(addr.c_str()+pos+2); } - + ret->sin6_scope_id=0; + ret->sin6_family=AF_INET6; + if(inet_pton(AF_INET6, ourAddr.c_str(), (void*)&ret->sin6_addr) != 1) { struct addrinfo* res; struct addrinfo hints;