summaryrefslogtreecommitdiffstats
path: root/framework/src/onos/apps/proxyarp
diff options
context:
space:
mode:
authorAshlee Young <ashlee@onosfw.com>2015-10-09 18:32:44 -0700
committerAshlee Young <ashlee@onosfw.com>2015-10-09 18:32:44 -0700
commit6a07d2d622eaa06953f3353e39c080984076e8de (patch)
treebfb50a2090fce186c2cc545a400c969bf2ea702b /framework/src/onos/apps/proxyarp
parente6d71622143ff9b2421a1abbe8434b954b5b1099 (diff)
Updated master to commit id 6ee8aa3e67ce89908a8c93aa9445c6f71a18f986
Change-Id: I94b055ee2f298daf71e2ec794fd0f2495bd8081f
Diffstat (limited to 'framework/src/onos/apps/proxyarp')
-rw-r--r--framework/src/onos/apps/proxyarp/src/main/java/org/onosproject/proxyarp/ProxyArp.java26
1 files changed, 18 insertions, 8 deletions
diff --git a/framework/src/onos/apps/proxyarp/src/main/java/org/onosproject/proxyarp/ProxyArp.java b/framework/src/onos/apps/proxyarp/src/main/java/org/onosproject/proxyarp/ProxyArp.java
index 2eb96df2..2eb1d5ec 100644
--- a/framework/src/onos/apps/proxyarp/src/main/java/org/onosproject/proxyarp/ProxyArp.java
+++ b/framework/src/onos/apps/proxyarp/src/main/java/org/onosproject/proxyarp/ProxyArp.java
@@ -23,6 +23,8 @@ import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.onlab.packet.Ethernet;
+import org.onlab.packet.ICMP6;
+import org.onlab.packet.IPv6;
import org.onosproject.cfg.ComponentConfigService;
import org.onosproject.core.ApplicationId;
import org.onosproject.core.CoreService;
@@ -214,27 +216,35 @@ public class ProxyArp {
if (context.isHandled()) {
return;
}
- // If IPv6 NDP is disabled, don't handle IPv6 frames.
+
InboundPacket pkt = context.inPacket();
Ethernet ethPkt = pkt.parsed();
if (ethPkt == null) {
return;
}
- if (!ipv6NeighborDiscovery && (ethPkt.getEtherType() == TYPE_IPV6)) {
- return;
+
+ if (ethPkt.getEtherType() == TYPE_ARP) {
+ //handle the arp packet.
+ proxyArpService.handlePacket(context);
+ } else if (ipv6NeighborDiscovery && ethPkt.getEtherType() == TYPE_IPV6) {
+ IPv6 ipv6Pkt = (IPv6) ethPkt.getPayload();
+ if (ipv6Pkt.getNextHeader() == IPv6.PROTOCOL_ICMP6) {
+ ICMP6 icmp6Pkt = (ICMP6) ipv6Pkt.getPayload();
+ if (icmp6Pkt.getIcmpType() == NEIGHBOR_SOLICITATION ||
+ icmp6Pkt.getIcmpType() == NEIGHBOR_ADVERTISEMENT) {
+ // handle ICMPv6 solicitations and advertisements
+ proxyArpService.handlePacket(context);
+ }
+ }
}
+ // FIXME why were we listening to IPv4 frames at all?
// 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);
}
}
}
-
-