Skip to content

Commit f692eb8

Browse files
author
Juha Heiskanen
committed
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
1 parent 386e5ff commit f692eb8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

source/6LoWPAN/ws/ws_bbr_api.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646

4747
#ifdef HAVE_WS_BORDER_ROUTER
4848

49+
#define WS_ULA_LIFETIME 24*3600
50+
#define WS_ROUTE_LIFETIME WS_ULA_LIFETIME
51+
#define WS_DHCPV_ADDRESS_LIFETIME 2*3600
4952

5053
/* when creating BBR make ULA dodag ID always and when network becomes available add prefix to DHCP
5154
*
@@ -135,8 +138,8 @@ static void ws_bbr_ula_prefix_enable(uint8_t *dodag_id)
135138

136139
uint8_t t_flags = PIO_A;
137140

138-
rpl_control_update_dodag_prefix(protocol_6lowpan_rpl_root_dodag, dodag_id, 64, t_flags, 7200, 7200, false);
139-
rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, dodag_id, 64, 0x18, 7200, false);
141+
rpl_control_update_dodag_prefix(protocol_6lowpan_rpl_root_dodag, dodag_id, 64, t_flags, WS_ULA_LIFETIME, WS_ULA_LIFETIME, false);
142+
rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, dodag_id, 64, 0x18, WS_ULA_LIFETIME, false);
140143
}
141144

142145

@@ -293,7 +296,7 @@ static void ws_bbr_dhcp_server_start(protocol_interface_info_entry_t *cur, uint8
293296
DHCPv6_server_service_callback_set(cur->id, global_id, NULL, wisun_dhcp_address_add_cb);
294297

295298
DHCPv6_server_service_set_address_autonous_flag(cur->id, global_id, true);
296-
DHCPv6_server_service_set_address_validlifetime(cur->id, global_id, 7200);
299+
DHCPv6_server_service_set_address_validlifetime(cur->id, global_id, WS_DHCPV_ADDRESS_LIFETIME);
297300

298301
ws_dhcp_client_address_request(cur, global_id, ll);
299302
}
@@ -352,7 +355,7 @@ static void ws_bbr_rpl_status_check(protocol_interface_info_entry_t *cur)
352355
uint8_t t_flags = 0;
353356

354357
// Add default route to RPL
355-
rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, NULL, 0, 0, 7200, false);
358+
rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, NULL, 0, 0, WS_ROUTE_LIFETIME, false);
356359
// Enable default routing to backbone
357360
ipv6_route_add_with_info(global_id, 64, backbone_interface_id, NULL, ROUTE_THREAD_BBR, NULL, 0, 0xffffffff, 0);
358361

@@ -368,7 +371,7 @@ static void ws_bbr_rpl_status_check(protocol_interface_info_entry_t *cur)
368371
// Add also global prefix and route to RPL
369372
uint32_t valid_lifetime;
370373
if (t_flags & PIO_A) {
371-
valid_lifetime = 7200;
374+
valid_lifetime = WS_ULA_LIFETIME;
372375
} else {
373376
valid_lifetime = 0;
374377
}
@@ -378,7 +381,7 @@ static void ws_bbr_rpl_status_check(protocol_interface_info_entry_t *cur)
378381
}
379382
if (configuration & BBR_GUA_ROUTE) {
380383
// Add also global prefix and route to RPL
381-
rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, global_id, 64, 0, 7200, false);
384+
rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, global_id, 64, 0, WS_ROUTE_LIFETIME, false);
382385
}
383386

384387
}

0 commit comments

Comments
 (0)