Remove ula_compat feature
authorSteven Barth <steven@midlink.org>
Fri, 3 Jan 2014 10:40:07 +0000 (11:40 +0100)
committerSteven Barth <steven@midlink.org>
Fri, 3 Jan 2014 10:40:07 +0000 (11:40 +0100)
README
src/config.c
src/dhcpv6-ia.c
src/odhcpd.h
src/router.c

diff --git a/README b/README
index 72a2674377d0b9c0cfe968dad574908139d17d2b..0d599521e8952dc09b36924cae98439ce4925138 100644 (file)
--- a/README
+++ b/README
@@ -93,7 +93,6 @@ leasetime     string  12h                     DHCPv4 address leasetime
 start          integer 100                     DHCPv4 pool start
 limit          integer 150                     DHCPv4 pool size
 
-ula_compat     bool    0                       Announce ULA in compat mode
 ra_default     integer 0                       Override default route
                0: default, 1: ignore no public address, 2: ignore all
 ra_management  integer 1                       RA management mode
index ed80befd735f9eba711145d258be8527fbe947a2..38a3e7a8ab94e91e6a0811b140f4a1ac8edfe1b9 100644 (file)
@@ -32,7 +32,6 @@ enum {
        IFACE_ATTR_NDP,
        IFACE_ATTR_DNS,
        IFACE_ATTR_DOMAIN,
-       IFACE_ATTR_ULA_COMPAT,
        IFACE_ATTR_RA_DEFAULT,
        IFACE_ATTR_RA_MANAGEMENT,
        IFACE_ATTR_RA_OFFLINK,
@@ -60,7 +59,6 @@ static const struct blobmsg_policy iface_attrs[IFACE_ATTR_MAX] = {
        [IFACE_ATTR_NDP] = { .name = "ndp", .type = BLOBMSG_TYPE_STRING },
        [IFACE_ATTR_DNS] = { .name = "dns", .type = BLOBMSG_TYPE_ARRAY },
        [IFACE_ATTR_DOMAIN] = { .name = "domain", .type = BLOBMSG_TYPE_ARRAY },
-       [IFACE_ATTR_ULA_COMPAT] = { .name = "ula_compat", .type = BLOBMSG_TYPE_BOOL },
        [IFACE_ATTR_RA_DEFAULT] = { .name = "ra_default", .type = BLOBMSG_TYPE_INT32 },
        [IFACE_ATTR_RA_MANAGEMENT] = { .name = "ra_management", .type = BLOBMSG_TYPE_INT32 },
        [IFACE_ATTR_RA_OFFLINK] = { .name = "ra_offlink", .type = BLOBMSG_TYPE_BOOL },
@@ -448,9 +446,6 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
                }
        }
 
-       if ((c = tb[IFACE_ATTR_ULA_COMPAT]))
-               iface->deprecate_ula_if_public_avail = blobmsg_get_bool(c);
-
        if ((c = tb[IFACE_ATTR_RA_DEFAULT]))
                iface->default_router = blobmsg_get_u32(c);
 
index bdaa3dae1ea140d733c9298cb7bcd99c0f25bdfb..3d6b7868433870a1c7260efd9eba090bf7f51512 100644 (file)
@@ -552,10 +552,6 @@ static size_t append_reply(uint8_t *buf, size_t buflen, uint16_t status,
                if (a) {
                        uint32_t pref = 3600;
                        uint32_t valid = 3600;
-                       bool have_non_ula = false;
-                       for (size_t i = 0; i < iface->ia_addr_len; ++i)
-                               if ((iface->ia_addr[i].addr.s6_addr[0] & 0xfe) != 0xfc)
-                                       have_non_ula = true;
 
                        for (size_t i = 0; i < iface->ia_addr_len; ++i) {
                                bool match = true;
@@ -580,12 +576,6 @@ static size_t append_reply(uint8_t *buf, size_t buflen, uint16_t status,
                                                iface->ia_addr[i].preferred <= (uint32_t)now)
                                        continue;
 
-                               // ULA-deprecation compatibility workaround
-                               if ((iface->ia_addr[i].addr.s6_addr[0] & 0xfe) == 0xfc &&
-                                               a->length == 128 && have_non_ula &&
-                                               iface->deprecate_ula_if_public_avail)
-                                       continue;
-
                                if (prefix_pref > 86400)
                                        prefix_pref = 86400;
 
index 727c638f1680807c70a2928514473e97afa83f84..77376cbc5f6ef70a91069d3b423b306b8b3557a7 100644 (file)
@@ -130,7 +130,6 @@ struct interface {
        bool master;
        bool ignore;
        bool always_rewrite_dns;
-       bool deprecate_ula_if_public_avail;
        bool ra_not_onlink;
        bool no_dynamic_dhcp;
 
index 7b81f71ebec07591764fc9802216798e6251a5bb..a75b847fbb2b29de358b75ac3c8e757236c2c3c5 100644 (file)
@@ -345,11 +345,6 @@ static void send_router_advert(struct uloop_timeout *event)
                adv.h.nd_ra_router_lifetime = 0;
        }
 
-       if (have_public && iface->deprecate_ula_if_public_avail)
-               for (size_t i = 0; i < cnt; ++i)
-                       if ((adv.prefix[i].nd_opt_pi_prefix.s6_addr[0] & 0xfe) == 0xfc)
-                               adv.prefix[i].nd_opt_pi_preferred_time = 0;
-
        // DNS Recursive DNS
        if (iface->dns_cnt > 0) {
                dns_addr = iface->dns;