For details see: http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=a18bf3149a9a2d41cf...
Signed-off-by: Matthias Fischer matthias.fischer@ipfire.org --- lfs/dnsmasq | 1 + ...d_losing_timer_when_deleting_a_RA_context.patch | 68 ++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 src/patches/dnsmasq/004-Avoid_losing_timer_when_deleting_a_RA_context.patch
diff --git a/lfs/dnsmasq b/lfs/dnsmasq index b9ddf12..67e6a61 100644 --- a/lfs/dnsmasq +++ b/lfs/dnsmasq @@ -76,6 +76,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/001-Fix_FTBFS_on_illumos.patch cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/002-Make_names_of_ARP_script_actions_consistent.patch cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/003-Fix_breakage_in_ARP_code_when_IPV6_support_not_compiled_in.patch + cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/004-Avoid_losing_timer_when_deleting_a_RA_context.patch cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch
cd $(DIR_APP) && sed -i src/config.h \ diff --git a/src/patches/dnsmasq/004-Avoid_losing_timer_when_deleting_a_RA_context.patch b/src/patches/dnsmasq/004-Avoid_losing_timer_when_deleting_a_RA_context.patch new file mode 100644 index 0000000..3396312 --- /dev/null +++ b/src/patches/dnsmasq/004-Avoid_losing_timer_when_deleting_a_RA_context.patch @@ -0,0 +1,68 @@ +From a18bf3149a9a2d41cf2c5b56908bc3d5c44f6d34 Mon Sep 17 00:00:00 2001 +From: S L sl4ever@gmail.com +Date: Fri, 12 Feb 2016 17:36:20 +0000 +Subject: [PATCH] Avoid losing timer when deleting a RA context. + +--- + src/radv.c | 19 ++++++++++++++----- + 1 file changed, 14 insertions(+), 5 deletions(-) + +diff --git a/src/radv.c b/src/radv.c +index 5c5382f..749b666 100644 +--- a/src/radv.c ++++ b/src/radv.c +@@ -28,11 +28,12 @@ + + struct ra_param { + time_t now; +- int ind, managed, other, found_context, first, adv_router; ++ int ind, managed, other, first, adv_router; + char *if_name; + struct dhcp_netid *tags; + struct in6_addr link_local, link_global, ula; + unsigned int glob_pref_time, link_pref_time, ula_pref_time, adv_interval, prio; ++ struct dhcp_context *found_context; + }; + + struct search_param { +@@ -251,7 +252,7 @@ static void send_ra_alias(time_t now, int iface, char *iface_name, struct in6_ad + parm.ind = iface; + parm.managed = 0; + parm.other = 0; +- parm.found_context = 0; ++ parm.found_context = NULL; + parm.adv_router = 0; + parm.if_name = iface_name; + parm.first = 1; +@@ -308,8 +309,14 @@ static void send_ra_alias(time_t now, int iface, char *iface_name, struct in6_ad + unsigned int old = difftime(now, context->address_lost_time); + + if (old > context->saved_valid) +- { ++ { + /* We've advertised this enough, time to go */ ++ ++ /* If this context held the timeout, and there's another context in use ++ transfer the timeout there. */ ++ if (context->ra_time != 0 && parm.found_context && parm.found_context->ra_time == 0) ++ new_timeout(parm.found_context, iface_name, now); ++ + *up = context->next; + free(context); + } +@@ -636,8 +643,10 @@ static int add_prefixes(struct in6_addr *local, int prefix, + off_link = (context->flags & CONTEXT_RA_OFF_LINK); + } + +- param->first = 0; +- param->found_context = 1; ++ param->first = 0; ++ /* found_context is the _last_ one we found, so if there's ++ more than one, it's not the first. */ ++ param->found_context = context; + } + + /* configured time is ceiling */ +-- +1.7.10.4 +