~ubuntu-branches/ubuntu/maverick/pdns/maverick-updates

« back to all changes in this revision

Viewing changes to pdns/dnsproxy.cc

  • Committer: Bazaar Package Importer
  • Author(s): Matthijs Mohlmann, Matthijs Mohlmann, Christoph Haas
  • Date: 2007-04-15 23:23:39 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070415232339-5x3scc8gx04e50um
Tags: 2.9.21-1
[ Matthijs Mohlmann ]
* New upstream release. (Closes: #420294)
* Remove meta pdns package.
* Added new sqlite3 backend package.
* Months and minutes where mixed up. (Closes: #406462)
* Case sensitivity in bind backend caused PowerDNS to not serve a certain
  zone. (Closes: #406461)
* Bind backend forgot about zones on a notify. (Closes: #398213)

[ Christoph Haas ]
* Documented incorporated backend bind. (Closes: #415471)

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 
14
14
    You should have received a copy of the GNU General Public License
15
15
    along with this program; if not, write to the Free Software
16
 
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
16
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
17
*/
18
18
#include "utility.hh"
19
19
#include "dnsproxy.hh"
93
93
 
94
94
bool DNSProxy::recurseFor(DNSPacket* p)
95
95
{
96
 
  return d_ng.match((struct sockaddr_in *)&p->remote);
 
96
  return d_ng.match((ComboAddress *)&p->remote);
97
97
}
98
98
 
99
99
/** returns false if p->remote is not allowed to recurse via us */
109
109
 
110
110
    ConntrackEntry ce;
111
111
    ce.id       = p->d.id;
112
 
    memcpy((void *)&ce.remote,(void *)&p->remote, p->d_socklen);
113
 
    ce.addrlen  = p->d_socklen;
 
112
    memcpy((void *)&ce.remote,(void *)&p->remote, p->remote.getSocklen()); 
 
113
    ce.addrlen  = p->remote.getSocklen();
114
114
    ce.outsock  = p->getSocket();
115
115
    ce.created  = time( NULL );
116
116
 
139
139
    else if(i->second.created<time(0)-60) {
140
140
      if(i->second.created)
141
141
        L<<Logger::Warning<<"Recursive query for remote "<<
142
 
          sockAddrToString((struct sockaddr_in *)&i->second.remote, i->second.addrlen)<<" with internal id "<<n<<
 
142
          sockAddrToString((struct sockaddr_in *)&i->second.remote)<<" with internal id "<<n<<
143
143
          " was not answered by backend within timeout, reusing id"<<endl;
144
144
      
145
145
      return n;
167
167
      }
168
168
      (*d_resanswers)++;
169
169
      (*d_udpanswers)++;
170
 
      DNSPacket::dnsheader d;
 
170
      dnsheader d;
171
171
      memcpy(&d,buffer,sizeof(d));
172
172
      {
173
173
        Lock l(&d_lock);