Remove support for lost prefixes
authorSteven Barth <steven@midlink.org>
Thu, 17 Jan 2013 07:34:19 +0000 (08:34 +0100)
committerSteven Barth <steven@midlink.org>
Thu, 17 Jan 2013 07:34:19 +0000 (08:34 +0100)
README
src/dhcpv6.c
src/odhcp6c.c
src/odhcp6c.h
src/script.c

diff --git a/README b/README
index 50b4a2814c2e9e8e15925a61af467e6f7fa99e45..421475fe7c7f53519f57a0501ccab2879b356616 100644 (file)
--- a/README
+++ b/README
@@ -56,7 +56,6 @@ Environment:
 * OPTION_<num> Custom option received as base-16
 * PREFIXES             A space-separated list of prefixes currently assigned
                                Format: <prefix>/<length>,preferred,valid
-* PREFIXES_LOST        A space-separated list of prefixes lost since last update
 
 
 
index 4dcf8e44fad43388ba69caaf7f6f558db2274205..9cb55adc28b935de24d254e8014481558c6ba183 100644 (file)
@@ -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))
index 163db09356bfc68dbc7fde4af925f4514b463ba5..02f926aac3b00e7f6a4758e0344a4b54d3cc1168 100644 (file)
@@ -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)
index 442393b0b5bde7aeac8d6769aba379c0ccaf7dc7..04a32ecf8a26a7cf2328ced475e1759e2552cfec 100644 (file)
@@ -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,
index ae791cc1d2913d01939a8a80230f41e4784aaa02..f0d4af2e9ce3e4841aa71277d407cdaa9c9b0ac8 100644 (file)
@@ -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);
 }