packet: Add function ip_is_local_multicast()
authorFlavio Leitner <fbl@redhat.com>
Fri, 11 Apr 2014 21:34:08 +0000 (18:34 -0300)
committerBen Pfaff <blp@nicira.com>
Mon, 19 May 2014 22:52:17 +0000 (15:52 -0700)
RFC4541- IGMP and MLD Snooping Switches Considerations
recommends to have different actions for local and
non-local multicast traffic.

Acked-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/packets.h

index 10eac67..4575dd0 100644 (file)
@@ -446,6 +446,11 @@ ip_is_multicast(ovs_be32 ip)
 {
     return (ip & htonl(0xf0000000)) == htonl(0xe0000000);
 }
+static inline bool
+ip_is_local_multicast(ovs_be32 ip)
+{
+    return (ip & htonl(0xffffff00)) == htonl(0xe0000000);
+}
 int ip_count_cidr_bits(ovs_be32 netmask);
 void ip_format_masked(ovs_be32 ip, ovs_be32 mask, struct ds *);