From 39d2d9b29075a363323264b3453ce6c17dd90a6c Mon Sep 17 00:00:00 2001 From: bert hubert Date: Mon, 5 Jan 2015 12:46:50 +0100 Subject: [PATCH] if we make an IPv6 address struct, make sure it has that family, and that the scope_id is zeroed of not set explicitly --- pdns/misc.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.47.2