[Dnsmasq-discuss] Hint needed: neither patched 'dnsmasq 2.75' nor '2.76test4' will compile
Lonnie Abelbeck
lists at lonnie.abelbeck.com
Tue Jan 5 17:18:57 GMT 2016
On Jan 5, 2016, at 10:29 AM, Matthias Fischer <matthias.fischer at ipfire.org> wrote:
> Hi,
>
> On 05.01.2016 17:05, Lonnie Abelbeck wrote:
>> Hi Matthias,
>>
>> It seems you have disabled HAVE_DHCP with enabled HAVE_SCRIPT.
>>
>> Try disabling HAVE_SCRIPT in your build system...
>> --
>> -e 's|#define HAVE_SCRIPT|//#define HAVE_SCRIPT|g' \
>> --
>
> Thanks, but sorry, it seems that this worked only partially:
When you disable HAVE_DHCP then do_script_run() is no longer defined in lease.c .
So this section needs needs a #ifdef HAVE_DHCP ... #endif, either in whole or in pieces. As 2.75 (original) did.
-- dnsmasq.c [4ab56f1610750f16ef2afb86a369406f3aa906c3] --
921 #ifdef HAVE_SCRIPT
922 while (helper_buf_empty() && do_script_run(now));
923 while (helper_buf_empty() && do_arp_script_run());
924
925 # ifdef HAVE_TFTP
926 while (helper_buf_empty() && do_tftp_script_run());
927 # endif
928
929 if (!helper_buf_empty())
930 poll_listen(daemon->helperfd, POLLOUT);
931 #else
932 /* need this for other side-effects */
933 while (do_script_run(now));
934 while (do_arp_script_run(now));
935
936 # ifdef HAVE_TFTP
937 while (do_tftp_script_run());
938 # endif
939
940 #endif
--
Also the do_arp_script_run() has inconstant args (ie. remove "now").
Also HAVE_DHCP possibly here ?...
--
1315 #if defined(HAVE_SCRIPT)
1316 /* handle pending lease transitions */
1317 if (daemon->helperfd != -1)
1318 {
1319 /* block in writes until all done */
1320 if ((i = fcntl(daemon->helperfd, F_GETFL)) != -1)
1321 fcntl(daemon->helperfd, F_SETFL, i & ~O_NONBLOCK);
1322 do {
1323 helper_write();
1324 } while (!helper_buf_empty() || do_script_run(now));
1325 while (retry_send(close(daemon->helperfd)));
1326 }
1327 #endif
--
Simon knows best on how to fix this.
I suspect disabling HAVE_DHCP is somewhat unusual, hence you are hitting these issues.
Alternatively, you could build with HAVE_DHCP, disable HAVE_DHCP6 (leave HAVE_SCRIPT the default) and then disable (don't enable) dhcp at runtime via your /etc/dnsmasq.conf .
Lonnie
More information about the Dnsmasq-discuss
mailing list