diff options
author | Simon Kelley <simon@thekelleys.org.uk> | 2021-12-30 21:20:37 +0000 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2021-12-30 21:20:37 +0000 |
commit | d242cbffa4f20c9f7472f79b3a9e47008b6fe77c (patch) | |
tree | 1459bde62515b258d3061df9740aec64be9f6f2e /src/dnsmasq.c | |
parent | 1c8855ed10d3923a9a4fd8a89f1c95439d4c8827 (diff) | |
download | dnsmasq-dhcpv6-snoop.tar.gz |
Add snooping of DHCPv6 prefix delegation to the DHCP-relay function.dhcpv6-snoop
Diffstat (limited to 'src/dnsmasq.c')
-rw-r--r-- | src/dnsmasq.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/dnsmasq.c b/src/dnsmasq.c index 2fe9808..422e40f 100644 --- a/src/dnsmasq.c +++ b/src/dnsmasq.c @@ -734,7 +734,11 @@ int main (int argc, char **argv) /* if we are to run scripts, we need to fork a helper before dropping root. */ daemon->helperfd = -1; #ifdef HAVE_SCRIPT - if ((daemon->dhcp || daemon->dhcp6 || option_bool(OPT_TFTP) || option_bool(OPT_SCRIPT_ARP)) && + if ((daemon->dhcp || + daemon->dhcp6 || + daemon->relay6 || + option_bool(OPT_TFTP) || + option_bool(OPT_SCRIPT_ARP)) && (daemon->lease_change_command || daemon->luascript)) daemon->helperfd = create_helper(pipewrite, err_pipe[1], script_uid, script_gid, max_fd); #endif @@ -1139,6 +1143,10 @@ int main (int argc, char **argv) while (helper_buf_empty() && do_tftp_script_run()); # endif +# ifdef HAVE_DHCP6 + while (helper_buf_empty() && do_snoop_script_run()); +# endif + if (!helper_buf_empty()) poll_listen(daemon->helperfd, POLLOUT); #else @@ -1153,6 +1161,11 @@ int main (int argc, char **argv) while (do_tftp_script_run()); # endif +# ifdef HAVE_DHCP6 + while (helper_buf_empty() && do_snoop_script_run()); +# endif + + #endif |