From dd5f1f8ca0a24d23dc426d6e89d9855a7b97fcec Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Thu, 17 Jan 2013 08:34:19 +0100 Subject: [PATCH] Remove support for lost prefixes --- README | 1 - src/dhcpv6.c | 4 ---- src/odhcp6c.c | 4 +--- src/odhcp6c.h | 1 - src/script.c | 5 +---- 5 files changed, 2 insertions(+), 13 deletions(-) diff --git a/README b/README index 50b4a28..421475f 100644 --- a/README +++ b/README @@ -56,7 +56,6 @@ Environment: * OPTION_ Custom option received as base-16 * PREFIXES A space-separated list of prefixes currently assigned Format: /,preferred,valid -* PREFIXES_LOST A space-separated list of prefixes lost since last update diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 4dcf8e4..9cb55ad 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -772,10 +772,6 @@ static time_t dhcpv6_parse_ia(void *opt, void *end) if (timeout > valid) timeout = valid; - - if (prefix->valid == 0) // We probably lost that prefix - odhcp6c_add_state(STATE_IA_PD_LOST, - prefix, olen); } else if (otype == DHCPV6_OPT_IA_ADDR) { struct dhcpv6_ia_addr *addr = (void*)&odata[-4]; if (olen + 4U < sizeof(*addr)) diff --git a/src/odhcp6c.c b/src/odhcp6c.c index 163db09..02f926a 100644 --- a/src/odhcp6c.c +++ b/src/odhcp6c.c @@ -170,7 +170,6 @@ int main(_unused int argc, char* const argv[]) odhcp6c_clear_state(STATE_SERVER_ID); odhcp6c_clear_state(STATE_SERVER_CAND); odhcp6c_clear_state(STATE_IA_PD); - odhcp6c_clear_state(STATE_IA_PD_LOST); odhcp6c_clear_state(STATE_SNTP_IP); odhcp6c_clear_state(STATE_SNTP_FQDN); odhcp6c_clear_state(STATE_SIP_IP); @@ -261,12 +260,11 @@ int main(_unused int argc, char* const argv[]) size_t ia_pd_len, ia_na_len, server_id_len; - uint8_t *ia_pd = odhcp6c_get_state(STATE_IA_PD, &ia_pd_len); + odhcp6c_get_state(STATE_IA_PD, &ia_pd_len); odhcp6c_get_state(STATE_IA_NA, &ia_na_len); odhcp6c_get_state(STATE_SERVER_ID, &server_id_len); // Add all prefixes to lost prefixes - odhcp6c_add_state(STATE_IA_PD_LOST, ia_pd, ia_pd_len); odhcp6c_clear_state(STATE_IA_PD); if (do_signal == SIGALRM) diff --git a/src/odhcp6c.h b/src/odhcp6c.h index 442393b..04a32ec 100644 --- a/src/odhcp6c.h +++ b/src/odhcp6c.h @@ -157,7 +157,6 @@ enum odhcp6c_state { STATE_SEARCH, STATE_IA_NA, STATE_IA_PD, - STATE_IA_PD_LOST, STATE_CUSTOM_OPTS, STATE_SNTP_IP, STATE_SNTP_FQDN, diff --git a/src/script.c b/src/script.c index ae791cc..f0d4af2 100644 --- a/src/script.c +++ b/src/script.c @@ -170,9 +170,8 @@ void script_call(const char *status) struct in6_addr *sip = odhcp6c_get_state(STATE_SIP_IP, &sip_ip_len); uint8_t *sip_fqdn = odhcp6c_get_state(STATE_SIP_FQDN, &sip_fqdn_len); - size_t prefix_len, lost_pd_len; + size_t prefix_len; uint8_t *prefix = odhcp6c_get_state(STATE_IA_PD, &prefix_len); - uint8_t *lost_pd = odhcp6c_get_state(STATE_IA_PD_LOST, &lost_pd_len); // Don't set environment before forking, because env is leaky. if (fork() == 0) { @@ -184,7 +183,6 @@ void script_call(const char *status) fqdn_to_env("SIP_DOMAIN", sip_fqdn, sip_fqdn_len); bin_to_env(custom, custom_len); prefix_to_env("PREFIXES", prefix, prefix_len); - prefix_to_env("PREFIXES_LOST", lost_pd, lost_pd_len); argv[2] = (char*)status; execv(argv[0], argv); @@ -192,6 +190,5 @@ void script_call(const char *status) } // Delete lost prefixes and user opts - odhcp6c_clear_state(STATE_IA_PD_LOST); odhcp6c_clear_state(STATE_CUSTOM_OPTS); } -- 2.39.5