[Dnsmasq-discuss] v2.34 on Openbsd 4.0 (fix)

Simon Kelley simon at thekelleys.org.uk
Fri Oct 20 16:23:15 BST 2006

Jeb Campbell wrote:
> Simon Kelley wrote:
>> I've done a bit of poking around in the OpenBSD CVSweb.
>> It looks like 4.0 has, at long last, got around to implementing the
>> IP_RECVIF socket option. At least IP_RECVIF now exists in the headers.
>> Assuming that you re-compile on a 4.0 machine, that means that the code
>> will attempt to use IP_RECVIF to read the interface on which incoming
>> packets arrive. (On older releases, it used a disgusting hack, and just
>> assumed that it was the single allowed interface.)
>> If the header declaration is there, but not the kernel support, then
>> dnsmasq will try and fail to find the interface, and silently ditch the
>> packet.
>> As a hypothesis, this fits the known facts. The ktrace results would
>> help confirm it.
> Thank you so much for your help!  I just can't say it enough that
> dnsmasq is one of the most useful programs out there (I shudder thinking
> of bind configs...).
> I had to put ktrace back in the kernel and I can install and test tonight.
> I'll let you know how it goes.
> As I can test the binary faster/safer than a remote update, I might try
> disabling IP_RECVIF and see if that fixes it.
> UPDATE -- that did it!  At the end of src/dnsmasq.h I added "#undef
> IP_RECVIF" and it works great!  Of course I should probably wrap that
> with a #ifdef OpenBSD ...
> Do you still want me to ktrace?

No, your tests give as much information as the ktrace would. I wonder
which it's not working: the code seems to be there in the OpenBSD kernel
to implement IP_RECVIF. I'll install 4.0 under qemu and have a poke around.

I'm reluctant to just always disable this under openBSD: using IP_RECVIF
is much better than not: I guess I'll have to add code to fall-back at
runtime on a broken system. Sigh.

> One last thing -- as a temp fix last night, I recompiled dnsmasq to read
> ISC lease files and it works great, but the source says that this will
> go away soon -- is it just not maintainable?

The main motivation for getting rid of it is that it's a hack which
depends on the ISC leasefile format not changing, and is rather
race-condition prone. Very few people use it, and it's quite likely that
it will get inadvertently broken. My plan is to remove it in the first
release after Debian "etch", which might well be 2.35.



More information about the Dnsmasq-discuss mailing list