[Pdns-dev] Re: [patch] dnspacket endian issue
Chris Andrews
chris at nodnol.org
Mon Sep 8 20:36:09 CEST 2003
On Mon, Sep 08, 2003 at 04:01:49PM +0200, bert hubert wrote:
> On Mon, Sep 08, 2003 at 03:41:52PM +0200, Norbert Sendetzky wrote:
> > On Monday 08 September 2003 13:56, bert hubert wrote:
> > > > Here's a small patch to fix an endian problem in the getAnswers()
> > > > function.
> > >
> > > Can you explain to me how you think that this will not break pdns
> > > on little endian platforms?
> >
> > ntohl() is a standard macro provided on all systems which is defined
> > differently on big endian and little endian architectures. On big
> > endian architectures it does nothing while it resorts the bytes on
> > little endian architectures.
>
> So there was a problem on Intel but not on sparc? I thought the complaint
> was the other way around.
My understanding of this was that my original patch which added
getLong included the ntohl() calls being added here, but should not
have. It had worked fine for me on Sparc (ntohl -> noop), but broke on
Intel, so bert removed those calls before applying the patch. As far
as I can see the code is correct as it stands.
Apologies for any confusion caused.
Chris.
More information about the Pdns-dev
mailing list