[Pdns-users] PDNS && Solaris && Recursor setting not working
Roderick Groesbeek
powerdns at roderick.triple-it.nl
Tue Feb 24 21:43:51 UTC 2004
[resent]
From: "Remco Post" <remco at pipsworld.nl>
To: "bert hubert" <ahu at ds9a.nl>
Cc: <pdns-users at mailman.powerdns.com>; "Roderick Groesbeek"
<powerdns at roderick.triple-it.nl>
Sent: Tuesday, February 24, 2004 9:32 PM
Subject: Re: [Pdns-users] PDNS && Solaris && Recursor setting not working
>
>
> I wrote the following lines, not very well tested, but it does help a
> little, the patch is against 2.9.15:
>
>
> *** pdns/dnsproxy.cc.old Fri Feb 6 14:00:51 2004
> --- pdns/dnsproxy.cc Mon Feb 9 22:29:18 2004
> ***************
> *** 172,177 ****
> --- 172,182 ----
> memcpy(&d,buffer,sizeof(d));
> {
> Lock l(&d_lock);
> + #ifdef WORDS_BIGENDIAN
> + // d.id is network-endian at this point and must be made into a
> 'native'-endian u_int16_t
> + // on little-endian systems, network-endian is native so we
> don't need to do anything
> + d.id = ( 256 * (u_int16_t)buffer[1] ) + (u_int16_t)buffer[0];
> + #endif
> map_t::iterator i=d_conntrack.find(d.id^d_xor);
> if(i==d_conntrack.end()) {
> L<<Logger::Error<<"Discarding untracked packet from recursor
> backend with id "<<(d.id^d_xor)<<
>
>
> --
> Met vriendelijke groeten,
>
> Remco Post
Remco,
Patched (against CVS), compiled, packaged, installed...
and it runned smoothly out of the box.
You are the man :-)
~~
22:18:35 rgroesb at ns1colo3:/usr/local/packages> nslookup - 80.69.66.173
> www.doei.nl
Server: ns1colo3.triple-it.nl
Address: 80.69.66.173
Non-authoritative answer:
Name: doei.nl
Address: 217.194.96.70
Aliases: www.doei.nl
> exit
22:18:49 rgroesb at ns1colo3:/usr/local/packages>
~~
Are there any more of these kind of BIG ENDIAN'ness in the source code?
I see the dnsheader has a part for BIG ENDIAN and a part for LITTLE ENDIAN,
but the 'id' has been left out.
~~
//! the raw DNS header
struct dnsheader
{
unsigned int id:16; //!< id of this query/response
#ifdef WORDS_BIGENDIAN // ultrasparc
unsigned int qr:1; //!< 1 if this is a query, 0 if response
~~
Aren't then any other locations where the ID has to be converted to some
form of little endianness??
Anyway.. time for dinner now. I cannot think about bit-fiddling with an
empty stomage.. :-)
Vriendelijke Groet,
Roderick
--
Pettemerstraat 12A T r I p l e
1823 CW Alkmaar T
Tel. +31 (0)72-5129516
fax. +31 (0)72-5129520 Automatisering
www.triple-it.nl "Laat uw Net Werken!"
More information about the Pdns-users
mailing list