diff options
| author | Mitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com> | 2017-07-12 14:27:24 -0700 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-08-08 10:28:55 -0400 |
| commit | 69b61704b8c125b34d3b8efe8fb6d1477c895eef (patch) | |
| tree | 7448f6d7b8af0eda7e4ecd4deb4401b753c79771 /lib/prefix.c | |
| parent | 297a21b66b885710f752a2fd42d2fa66db854259 (diff) | |
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 e67184f52b..edfc22fb42 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; |
