]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/prefix.c
Merge pull request #5806 from ton31337/fix/remove_break_after_return
[mirror_frr.git] / lib / prefix.c
index 7bfca40f9eb8a32dd033e868be2017960eb4d17e..2b7727fd0a3353479269903acb917f8adbfaa255 100644 (file)
@@ -56,6 +56,25 @@ int is_zero_mac(const struct ethaddr *mac)
        return 1;
 }
 
+bool is_bcast_mac(const struct ethaddr *mac)
+{
+       int i = 0;
+
+       for (i = 0; i < ETH_ALEN; i++)
+               if (mac->octet[i] != 0xFF)
+                       return false;
+
+       return true;
+}
+
+bool is_mcast_mac(const struct ethaddr *mac)
+{
+       if ((mac->octet[0] & 0x01) == 0x01)
+               return true;
+
+       return false;
+}
+
 unsigned int prefix_bit(const uint8_t *prefix, const uint16_t prefixlen)
 {
        unsigned int offset = prefixlen / 8;