From 63565b109d7c2e5aab5eb812d54924017f500247 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Fri, 10 Jun 2016 20:57:58 +0200 Subject: [PATCH] Fix TSCH_AUTOSELECT_TIME_SOURCE to work with 2-byte addresses and with the new nbr_table_add_lladdr interface --- core/net/mac/tsch/tsch.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/net/mac/tsch/tsch.c b/core/net/mac/tsch/tsch.c index 32942686e..af8600400 100644 --- a/core/net/mac/tsch/tsch.c +++ b/core/net/mac/tsch/tsch.c @@ -45,6 +45,7 @@ #include "net/netstack.h" #include "net/packetbuf.h" #include "net/queuebuf.h" +#include "net/nbr-table.h" #include "net/mac/framer-802154.h" #include "net/mac/tsch/tsch.h" #include "net/mac/tsch/tsch-slot-operation.h" @@ -282,13 +283,13 @@ eb_input(struct input_packet *current_input) #if TSCH_AUTOSELECT_TIME_SOURCE if(!tsch_is_coordinator) { /* Maintain EB received counter for every neighbor */ - struct eb_stat *stat = (struct eb_stat *)nbr_table_get_from_lladdr(eb_stats, &frame.src_addr); + struct eb_stat *stat = (struct eb_stat *)nbr_table_get_from_lladdr(eb_stats, (linkaddr_t *)&frame.src_addr); if(stat == NULL) { - stat = (struct eb_stat *)nbr_table_add_lladdr(eb_stats, &frame.src_addr); + stat = (struct eb_stat *)nbr_table_add_lladdr(eb_stats, (linkaddr_t *)&frame.src_addr, NBR_TABLE_REASON_MAC, NULL); } if(stat != NULL) { stat->rx_count++; - stat->jp = eb_ies.join_priority; + stat->jp = eb_ies.ie_join_priority; best_neighbor_eb_count = MAX(best_neighbor_eb_count, stat->rx_count); } /* Select best time source */