Merge pull request #858 from simonduq/contrib/tsch-discard-frames-from-ourselves

TSCH: filter out frames from ourselves
This commit is contained in:
Simon Duquennoy 2019-03-04 09:11:27 +01:00 committed by GitHub
commit abab7f1645
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -849,8 +849,12 @@ PT_THREAD(tsch_rx_slot(struct pt *pt, struct rtimer *t))
#endif /* LLSEC802154_ENABLED */
if(frame_valid) {
if(linkaddr_cmp(&destination_address, &linkaddr_node_addr)
|| linkaddr_cmp(&destination_address, &linkaddr_null)) {
/* Check that frome is for us or broadcast, AND that it is not from
* ourselves. This is for consistency with CSMA and to avoid adding
* ourselves to neighbor tables in case frames are being replayed. */
if((linkaddr_cmp(&destination_address, &linkaddr_node_addr)
|| linkaddr_cmp(&destination_address, &linkaddr_null))
&& !linkaddr_cmp(&source_address, &linkaddr_node_addr)) {
int do_nack = 0;
rx_count++;
estimated_drift = RTIMER_CLOCK_DIFF(expected_rx_time, rx_start_time);