gluon-ebtables-limit-arp: do not add multicast addresses to filter

With the batman-adv multicast support compiled back in again we end up
with multicast addresses in the batman-adv translation table.

Currently we wrongly interpret multicast addresses returned by TT as a
unique host, too, which adds them with a source address filter to
ebtables as well. However, the source address of an ethernet frames is
never supposed to be a multicat one.

This leads to unnecessary entries in ebtables. Fixing this by ignoring
those MAC addreses returned by TT which have the multicast bit set.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
This commit is contained in:
Linus Lüssing 2018-03-31 19:12:43 +02:00 committed by Matthias Schiffer
parent d5ef9b67c9
commit 951b6632bc
2 changed files with 8 additions and 0 deletions

View File

@ -248,6 +248,9 @@ static void ebt_tl_update(void)
break; break;
} }
if (mac_is_multicast(&mac))
continue;
ebt_add_mac(&mac); ebt_add_mac(&mac);
} }

View File

@ -16,4 +16,9 @@ struct mac_addr {
int mac_aton(const char *cp, struct mac_addr *mac); int mac_aton(const char *cp, struct mac_addr *mac);
char *mac_ntoa(struct mac_addr *mac); char *mac_ntoa(struct mac_addr *mac);
static inline int mac_is_multicast(struct mac_addr *addr)
{
return addr->storage[0] & 0x01;
}
#endif /* _MAC_H_ */ #endif /* _MAC_H_ */