Fix stateless mode
authorSteven Barth <steven@midlink.org>
Tue, 28 Jan 2014 16:40:46 +0000 (17:40 +0100)
committerSteven Barth <steven@midlink.org>
Tue, 28 Jan 2014 16:40:46 +0000 (17:40 +0100)
src/odhcp6c.c

index 1e8e2bc9a4023da3381578b7d56f304d959bf858..4a9267dc19e490781c7cadf7ac8261ab32755836 100644 (file)
@@ -62,7 +62,7 @@ int main(_unused int argc, char* const argv[])
        char *optpos;
        uint16_t opttype;
        enum odhcp6c_ia_mode ia_na_mode = IA_MODE_TRY;
-       enum odhcp6c_ia_mode ia_pd_mode = IA_MODE_TRY;
+       enum odhcp6c_ia_mode ia_pd_mode = IA_MODE_NONE;
        int ia_pd_iaid_index = 0;
        static struct in6_addr ifid = IN6ADDR_ANY_INIT;
        int sol_timeout = DHCPV6_SOL_MAX_RT;
@@ -104,6 +104,9 @@ int main(_unused int argc, char* const argv[])
 
                        break;
                case 'P':
+                       if (ia_pd_mode == IA_MODE_NONE)
+                               ia_pd_mode = IA_MODE_TRY;
+
                        if (allow_slaac_only >= 0 && allow_slaac_only < 10)
                                allow_slaac_only = 10;