On Friday, September 4, 2020 8:28:03 PM CEST Linus Lüssing wrote:
@@ -1626,7 +1626,8 @@ bool batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv, if (entry->crc != crc) continue;
if (batadv_compare_eth(entry->orig, bcast_packet->orig))
if (!is_zero_ether_addr(entry->orig) &&
batadv_compare_eth(entry->orig, orig)) continue; /* this entry seems to match: same crc, not too old,
Shouldn't this check also be skipped if the orig parameter is a zero mac address? i.e.:
if (!is_zero_ether_addr(orig)) { if (!is_zero_ether_addr(entry->orig) && batadv_compare_eth(entry->orig, orig)) continue; }
Whether orig is zero can probably be checked once before the loop and the result cached in a bool variable.
A little comment may also be nice to explain this part a bit better.
The rest looks good.
Cheers, Simon