config_dhcp.ia_na_mode = IA_MODE_TRY;
config_dhcp.ia_pd_mode = IA_MODE_NONE;
config_dhcp.client_options = DHCPV6_CLIENT_FQDN | DHCPV6_ACCEPT_RECONFIGURE;
- config_dhcp.allow_slaac_only = 0;
+ config_dhcp.allow_slaac_only = true;
config_dhcp.oro_user_cnt = 0;
memset(config_dhcp.message_rtx, 0, sizeof(config_dhcp.message_rtx));
config_dhcp.message_rtx[CONFIG_DHCP_SOLICIT].delay_max = DHCPV6_MAX_DELAY;
bool config_set_request_addresses(char* mode) {
if (!strcmp(mode, "force")) {
config_dhcp.ia_na_mode = IA_MODE_FORCE;
- config_dhcp.allow_slaac_only = -1;
+ config_dhcp.allow_slaac_only = false;
} else if (!strcmp(mode, "none")) {
config_dhcp.ia_na_mode = IA_MODE_NONE;
} else if (!strcmp(mode, "try")) {
void config_set_force_prefix(bool enable) {
if (enable) {
- config_dhcp.allow_slaac_only = -1;
+ config_dhcp.allow_slaac_only = false;
config_dhcp.ia_pd_mode = IA_MODE_FORCE;
} else {
config_dhcp.ia_pd_mode = IA_MODE_NONE;
config_dhcp.stateful_only_mode = enable;
}
-void config_set_allow_slaac_only(int value) {
+void config_set_allow_slaac_only(bool value) {
config_dhcp.allow_slaac_only = value;
}
dhcpv6_retx[DHCPV6_MSG_RELEASE].max_rc = config_dhcp.message_rtx[CONFIG_DHCP_RELEASE].rc_max;
dhcpv6_retx[DHCPV6_MSG_DECLINE].init_timeo = config_dhcp.message_rtx[CONFIG_DHCP_DECLINE].timeout_init;
dhcpv6_retx[DHCPV6_MSG_DECLINE].max_rc = config_dhcp.message_rtx[CONFIG_DHCP_DECLINE].rc_max;
-}
\ No newline at end of file
+}
enum odhcp6c_ia_mode ia_na_mode;
enum odhcp6c_ia_mode ia_pd_mode;
unsigned int client_options;
- int allow_slaac_only;
+ bool allow_slaac_only;
unsigned int oro_user_cnt;
struct config_dhcp_rtx message_rtx[CONFIG_DHCP_MAX];
uint32_t irt_default;
bool config_set_request_prefix(unsigned int length, unsigned int id);
void config_set_force_prefix(bool enable);
void config_set_stateful_only(bool enable);
-void config_set_allow_slaac_only(int value);
+void config_set_allow_slaac_only(bool value);
void config_clear_requested_options(void) ;
bool config_add_requested_options(unsigned int option);
void config_clear_send_options(void);
config_dhcp = config_dhcp_get();
config_dhcp_reset();
- while ((c = getopt(argc, argv, "S::DN:V:P:FB:c:i:r:Ru:Ux:s:EkK:t:C:m:Lhedp:fav")) != -1) {
+ while ((c = getopt(argc, argv, "SDN:V:P:FB:c:i:r:Ru:Ux:s:EkK:t:C:m:Lhedp:fav")) != -1) {
switch (c) {
case 'S':
- config_set_allow_slaac_only((optarg) ? atoi(optarg) : -1);
+ config_set_allow_slaac_only(false);
break;
case 'D':
signal_usr2 = true;
}
- if (ra_updated && (bound || config_dhcp->allow_slaac_only >= 0)) {
+ if (ra_updated && (bound || config_dhcp->allow_slaac_only)) {
notify_state_change("ra-updated", (!ra && !bound) ?
script_sync_delay : script_accu_delay, false);
ra = true;