Search
j0ke.net Open Build Service
>
Projects
>
home:jg
:
dns
>
pdns
> pdns-ipv6-bind.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File pdns-ipv6-bind.patch of Package pdns (Revision 23)
Currently displaying revision
23
,
show latest
diff -ur pdns-2.9.22.orig/pdns/nameserver.cc pdns-2.9.22.mod/pdns/nameserver.cc --- pdns-2.9.22.orig/pdns/nameserver.cc 2008-11-15 23:32:46.000000000 +0300 +++ pdns-2.9.22.mod/pdns/nameserver.cc 2011-06-03 14:01:41.000000000 +0400 @@ -150,6 +150,18 @@ ComboAddress locala(localname, ::arg().asNum("local-port")); + vector<string>locals4; + stringtok(locals4,::arg()["local-address"]," ,"); + if(! locals4.empty()) + { + L<<Logger::Error<<"Setting IPv6-only mode to "<< locala.toStringWithPort() <<endl; + int on = 1; + if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&on, sizeof(on))<0) + { + L<<Logger::Error<<"Setsockopt IPV6_V6ONLY failed"<<endl; + } + } + if(::bind(s, (sockaddr*)&locala, sizeof(locala))<0) { L<<Logger::Error<<"binding to UDP ipv6 socket: "<<strerror(errno)<<endl; throw AhuException("Unable to bind to UDP ipv6 socket"); Only in pdns-2.9.22.mod/pdns: patch diff -ur pdns-2.9.22.orig/pdns/tcpreceiver.cc pdns-2.9.22.mod/pdns/tcpreceiver.cc --- pdns-2.9.22.orig/pdns/tcpreceiver.cc 2011-06-02 13:47:54.000000000 +0400 +++ pdns-2.9.22.mod/pdns/tcpreceiver.cc 2011-06-03 14:01:11.000000000 +0400 @@ -564,6 +564,16 @@ exit(1); } + if(! locals.empty()) + { + tmp=1; + L<<Logger::Error<<"Setting IPv6-only mode to "<< local.toStringWithPort() <<endl; + if(setsockopt(s,IPPROTO_IPV6, IPV6_V6ONLY,(char*)&tmp,sizeof tmp)<0) { + L<<Logger::Error<<"Setsockopt IPV6_V6ONLY failed"<<endl; + exit(1); + } + } + if(bind(s, (const sockaddr*)&local, local.getSocklen())<0) { L<<Logger::Error<<"binding to TCP socket: "<<strerror(errno)<<endl; throw AhuException("Unable to bind to TCPv6 socket");