diff options
author | Mitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com> | 2017-07-12 23:27:24 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-08-08 16:28:55 +0200 |
commit | 69b61704b8c125b34d3b8efe8fb6d1477c895eef (patch) | |
tree | 7448f6d7b8af0eda7e4ecd4deb4401b753c79771 /lib/prefix.c | |
parent | zebra: zebra should not try and advertise gateway macip if EVPN is disabled (diff) | |
download | frr-69b61704b8c125b34d3b8efe8fb6d1477c895eef.tar.xz frr-69b61704b8c125b34d3b8efe8fb6d1477c895eef.zip |
lib: changes needed for mac access-list any command
Ticket: CM-17074
Review: CCR-6453
Unit-test: Manual
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
Diffstat (limited to 'lib/prefix.c')
-rw-r--r-- | lib/prefix.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/prefix.c b/lib/prefix.c index e67184f52..edfc22fb4 100644 --- a/lib/prefix.c +++ b/lib/prefix.c @@ -301,6 +301,18 @@ static const struct in6_addr maskbytes6[] = { #define MASKBIT(offset) ((0xff << (PNBBY - (offset))) & 0xff) +int is_zero_mac(struct ethaddr *mac) +{ + int i = 0; + + for (i = 0; i < ETH_ALEN; i++) { + if (mac->octet[i]) + return 0; + } + + return 1; +} + unsigned int prefix_bit(const u_char *prefix, const u_char prefixlen) { unsigned int offset = prefixlen / 8; |