[Dnsmasq-discuss] Error returning query result from FreeBSD jail

Jan Seiffert kaffeemonster at googlemail.com
Wed Apr 11 21:02:15 BST 2012

Simon Kelley schrieb:
> On 11/04/12 19:49, Jan Seiffert wrote:
>> I think the dnsmasq code is to blame here. First in util.c we have
>> the sa_len function. It returns the sa_len field for OS which have
>> it. Instead it should strictly go by sa_family, no matter what the
>> OS. And second, i can not find any place in the 2.60 source code
>> which actually sets the sa_len field, so it is probably sometimes
>> mem garbage.
> You're greping for the wrong thing: the field is set using the
> sin_len or sin6_len union elements.

Oh... hmmmpf.
I know why i have hidden that behind a little helper which does
nothing for the no-sa_len case...

> It will be something like this, but if it was the address that was
> wrong, it would fail when --bind-interfaces is set too, and it
> doesn't

look for example at forward.c::receive_query().
source_addr never get it's sa_len set (except if recvmsg does it), then
it's passed to send_from, where the len is put into the msg_namelen = sa_len(to).
But if --bind-interfaces fixes it...

> (Dave mailed me off list). There must be something wrong with
> the parameters sent only when setting the source address,

..i'm still not 100% convinced. I remember *BSD beeing picky in "funny" ways,
prop. depending on which kernel path is chosen.

> or maybe that's not possible in a jail?

Also possible

> Cheers,
> Simon.


Every time you email a file to yourself so you can pull it up on your
friend's laptop, Tim Berners-Lee sheds a single tear.

More information about the Dnsmasq-discuss mailing list