gluon/package/gluon-ebtables-limit-arp/src/mac.h
Linus Lüssing 951b6632bc 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>
2018-04-01 03:26:50 +02:00

25 lines
495 B
C

/*
* Copyright (c) 2017 Linus Lüssing <linus.luessing@c0d3.blue>
*
* SPDX-License-Identifier: GPL-2.0+
* License-Filename: LICENSE
*/
#ifndef _MAC_H_
#define _MAC_H_
struct mac_addr {
/* 8 instead of 6 for multiples of uint32_t for hashword() */
unsigned char storage[8];
};
int mac_aton(const char *cp, 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_ */