Stop proxyarp from handling mcast packets and a configuration item to
stop fwd from handling mcast packets.  FWD & ProxyArp checks the IPv4
mac address to determine if the packet is multicast.

Change-Id: Ibf1c207635badea2f3d2a824e8574f352bfbab16
diff --git a/apps/fwd/src/main/java/org/onosproject/fwd/ReactiveForwarding.java b/apps/fwd/src/main/java/org/onosproject/fwd/ReactiveForwarding.java
index 1a9d3be..c557dbb 100644
--- a/apps/fwd/src/main/java/org/onosproject/fwd/ReactiveForwarding.java
+++ b/apps/fwd/src/main/java/org/onosproject/fwd/ReactiveForwarding.java
@@ -155,6 +155,9 @@
                     "default is false")
     private boolean matchIcmpFields = false;
 
+    @Property(name = "ignoreIPv4Multicast", boolValue = false,
+            label = "Ignore (do not forward) IPv4 multicast packets; default is false")
+    private boolean ignoreIpv4McastPackets = false;
 
     @Activate
     public void activate(ComponentContext context) {
@@ -319,6 +322,14 @@
             log.info("Configured. Flow Priority is configured to {}",
                      flowPriority);
         }
+
+        boolean ignoreIpv4McastPacketsEnabled =
+                isPropertyEnabled(properties, "ignoreIpv4McastPackets");
+        if (ignoreIpv4McastPackets != ignoreIpv4McastPacketsEnabled) {
+            ignoreIpv4McastPackets = ignoreIpv4McastPacketsEnabled;
+            log.info("Configured. Ignore IPv4 multicast packets is {}",
+                    ignoreIpv4McastPackets ? "enabled" : "disabled");
+        }
     }
 
     /**
@@ -400,6 +411,13 @@
                 return;
             }
 
+            // Do not process IPv4 multicast packets, let mfwd handle them
+            if (ignoreIpv4McastPackets && ethPkt.getEtherType() == Ethernet.TYPE_IPV4) {
+                if (id.mac().isMulticast()) {
+                    return;
+                }
+            }
+
             // Do we know who this is for? If not, flood and bail.
             Host dst = hostService.getHost(id);
             if (dst == null) {
diff --git a/apps/proxyarp/src/main/java/org/onosproject/proxyarp/ProxyArp.java b/apps/proxyarp/src/main/java/org/onosproject/proxyarp/ProxyArp.java
index 6586a4e..136a418 100644
--- a/apps/proxyarp/src/main/java/org/onosproject/proxyarp/ProxyArp.java
+++ b/apps/proxyarp/src/main/java/org/onosproject/proxyarp/ProxyArp.java
@@ -223,6 +223,14 @@
             if (!ipv6NeighborDiscovery && (ethPkt.getEtherType() == TYPE_IPV6)) {
                 return;
             }
+
+            // Do not ARP for multicast packets.  Let mfwd handle them.
+            if (ethPkt.getEtherType() == Ethernet.TYPE_IPV4) {
+                if (ethPkt.getDestinationMAC().isMulticast()) {
+                    return;
+                }
+            }
+
             //handle the arp packet.
             proxyArpService.handlePacket(context);
         }