@@ -289,8 +289,17 @@ static void ws_bootstrap_pan_advertisement_analyse_active(struct protocol_interf
289
289
290
290
}
291
291
292
- static void ws_bootstrap_pan_advertisement_analyse (struct protocol_interface_info_entry * cur , const struct mcps_data_ind_s * data , ws_pan_information_t * pan_information , ws_utt_ie_t * ws_utt , ws_us_ie_t * ws_us )
292
+ static void ws_bootstrap_pan_advertisement_analyse (struct protocol_interface_info_entry * cur , const struct mcps_data_ind_s * data , const struct mcps_data_ie_list * ie_ext , ws_utt_ie_t * ws_utt , ws_us_ie_t * ws_us )
293
293
{
294
+
295
+ //Validate Pan Conrfirmation is at packet
296
+ ws_pan_information_t pan_information ;
297
+ if (!ws_wp_nested_pan_read (ie_ext -> payloadIeList , ie_ext -> payloadIeListLength , & pan_information )) {
298
+ // Corrupted
299
+ tr_error ("No pan information" );
300
+ return ;
301
+ }
302
+
294
303
// if in active scan state
295
304
if (!ws_bootstrap_state_discovery (cur )) {
296
305
if (data -> SrcPANId != cur -> ws_info -> network_pan_id ) {
@@ -300,9 +309,8 @@ static void ws_bootstrap_pan_advertisement_analyse(struct protocol_interface_inf
300
309
}
301
310
302
311
303
-
304
312
// Check pan flags so that it is valid
305
- if (!pan_information -> rpl_routing_method ) {
313
+ if (!pan_information . rpl_routing_method ) {
306
314
// NOT RPL routing
307
315
tr_warn ("Not supported routing" );
308
316
return ;
@@ -338,7 +346,7 @@ static void ws_bootstrap_pan_advertisement_analyse(struct protocol_interface_inf
338
346
cur -> ws_info -> parent_info .dwell_interval = ws_us -> dwell_interval ;
339
347
340
348
// Saved from Pan information
341
- cur -> ws_info -> parent_info .pan_configuration = * pan_information ;
349
+ cur -> ws_info -> parent_info .pan_configuration = pan_information ;
342
350
343
351
// Saved from message
344
352
cur -> ws_info -> parent_info .timestamp = data -> timestamp ;
@@ -353,7 +361,7 @@ static void ws_bootstrap_pan_advertisement_analyse(struct protocol_interface_inf
353
361
tr_info ("New possible parent found addr:%s" , trace_array (cur -> ws_info -> parent_info .addr , 8 ));
354
362
} else {
355
363
// Active state processing
356
- ws_bootstrap_pan_advertisement_analyse_active (cur , pan_information );
364
+ ws_bootstrap_pan_advertisement_analyse_active (cur , & pan_information );
357
365
}
358
366
// Parent valid store information
359
367
cur -> ws_info -> parent_info .ufsi = ws_utt -> ufsi ;
@@ -544,17 +552,10 @@ static void ws_bootstrap_asynch_ind(struct protocol_interface_info_entry *cur, c
544
552
// Not from long address
545
553
return ;
546
554
}
547
- ws_pan_information_t pan_information ;
548
-
555
+ //Validate network name
549
556
switch (message_type ) {
550
557
case WS_FT_PAN_ADVERT :
551
558
case WS_FT_PAN_ADVERT_SOL :
552
- //Validate Pan Corfirmation is at packet
553
- if (!ws_wp_nested_pan_read (ie_ext -> payloadIeList , ie_ext -> payloadIeListLength , & pan_information )) {
554
- // Corrupted
555
- tr_error ("No pan information" );
556
- return ;
557
- }
558
559
case WS_FT_PAN_CONF_SOL :
559
560
//Check Network Name
560
561
if (!ws_bootstrap_network_name_matches (ie_ext , cur -> ws_info -> network_name )) {
@@ -589,7 +590,7 @@ static void ws_bootstrap_asynch_ind(struct protocol_interface_info_entry *cur, c
589
590
case WS_FT_PAN_ADVERT :
590
591
// Analyse Advertisement
591
592
tr_debug ("received ADVERT" );
592
- ws_bootstrap_pan_advertisement_analyse (cur , data , & pan_information , & ws_utt , & ws_us );
593
+ ws_bootstrap_pan_advertisement_analyse (cur , data , ie_ext , & ws_utt , & ws_us );
593
594
break ;
594
595
case WS_FT_PAN_ADVERT_SOL :
595
596
tr_debug ("received ADVERT SOL" );
0 commit comments