From f692eb8de97ef4594f2d0643951940a18eba4b8f Mon Sep 17 00:00:00 2001 From: Juha Heiskanen Date: Wed, 5 Jun 2019 14:38:57 +0300 Subject: [PATCH] Wi-SUN border router configure update ULA prefix lidfeyime from 2 hours to 24 hours Route lifetime from 2 hours to 24 hours. Change-Id: I20604a64e36a013f1435c964f1a52fff66ca348a --- source/6LoWPAN/ws/ws_bbr_api.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/source/6LoWPAN/ws/ws_bbr_api.c b/source/6LoWPAN/ws/ws_bbr_api.c index bfa31bb6c0e..95ba270b318 100644 --- a/source/6LoWPAN/ws/ws_bbr_api.c +++ b/source/6LoWPAN/ws/ws_bbr_api.c @@ -46,6 +46,9 @@ #ifdef HAVE_WS_BORDER_ROUTER +#define WS_ULA_LIFETIME 24*3600 +#define WS_ROUTE_LIFETIME WS_ULA_LIFETIME +#define WS_DHCPV_ADDRESS_LIFETIME 2*3600 /* when creating BBR make ULA dodag ID always and when network becomes available add prefix to DHCP * @@ -135,8 +138,8 @@ static void ws_bbr_ula_prefix_enable(uint8_t *dodag_id) uint8_t t_flags = PIO_A; - rpl_control_update_dodag_prefix(protocol_6lowpan_rpl_root_dodag, dodag_id, 64, t_flags, 7200, 7200, false); - rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, dodag_id, 64, 0x18, 7200, false); + rpl_control_update_dodag_prefix(protocol_6lowpan_rpl_root_dodag, dodag_id, 64, t_flags, WS_ULA_LIFETIME, WS_ULA_LIFETIME, false); + rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, dodag_id, 64, 0x18, WS_ULA_LIFETIME, false); } @@ -293,7 +296,7 @@ static void ws_bbr_dhcp_server_start(protocol_interface_info_entry_t *cur, uint8 DHCPv6_server_service_callback_set(cur->id, global_id, NULL, wisun_dhcp_address_add_cb); DHCPv6_server_service_set_address_autonous_flag(cur->id, global_id, true); - DHCPv6_server_service_set_address_validlifetime(cur->id, global_id, 7200); + DHCPv6_server_service_set_address_validlifetime(cur->id, global_id, WS_DHCPV_ADDRESS_LIFETIME); ws_dhcp_client_address_request(cur, global_id, ll); } @@ -352,7 +355,7 @@ static void ws_bbr_rpl_status_check(protocol_interface_info_entry_t *cur) uint8_t t_flags = 0; // Add default route to RPL - rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, NULL, 0, 0, 7200, false); + rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, NULL, 0, 0, WS_ROUTE_LIFETIME, false); // Enable default routing to backbone ipv6_route_add_with_info(global_id, 64, backbone_interface_id, NULL, ROUTE_THREAD_BBR, NULL, 0, 0xffffffff, 0); @@ -368,7 +371,7 @@ static void ws_bbr_rpl_status_check(protocol_interface_info_entry_t *cur) // Add also global prefix and route to RPL uint32_t valid_lifetime; if (t_flags & PIO_A) { - valid_lifetime = 7200; + valid_lifetime = WS_ULA_LIFETIME; } else { valid_lifetime = 0; } @@ -378,7 +381,7 @@ static void ws_bbr_rpl_status_check(protocol_interface_info_entry_t *cur) } if (configuration & BBR_GUA_ROUTE) { // Add also global prefix and route to RPL - rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, global_id, 64, 0, 7200, false); + rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, global_id, 64, 0, WS_ROUTE_LIFETIME, false); } }