diff --git a/core/net/mac/nullrdc.c b/core/net/mac/nullrdc.c index 6b8cbe2e3..b57dcb729 100644 --- a/core/net/mac/nullrdc.c +++ b/core/net/mac/nullrdc.c @@ -52,6 +52,12 @@ #define PRINTF(...) #endif +#ifdef NULLRDC_CONF_ADDRESS_FILTER +#define NULLRDC_ADDRESS_FILTER NULLRDC_CONF_ADDRESS_FILTER +#else +#define NULLRDC_ADDRESS_FILTER 1 +#endif /* NULLRDC_CONF_ADDRESS_FILTER */ + #ifndef NULLRDC_802154_AUTOACK #ifdef NULLRDC_CONF_802154_AUTOACK #define NULLRDC_802154_AUTOACK NULLRDC_CONF_802154_AUTOACK @@ -206,6 +212,13 @@ packet_input(void) #endif /* NULLRDC_802154_AUTOACK */ if(NETSTACK_FRAMER.parse() == 0) { PRINTF("nullrdc: failed to parse %u\n", packetbuf_datalen()); +#if NULLRDC_ADDRESS_FILTER + } else if(!rimeaddr_cmp(packetbuf_addr(PACKETBUF_ADDR_RECEIVER), + &rimeaddr_node_addr) && + !rimeaddr_cmp(packetbuf_addr(PACKETBUF_ADDR_RECEIVER), + &rimeaddr_null)) { + PRINTF("nullrdc: not for us\n"); +#endif /* NULLRDC_ADDRESS_FILTER */ } else { #if NULLRDC_802154_AUTOACK || NULLRDC_802154_AUTOACK_HW /* Check for duplicate packet by comparing the sequence number