Hyunsun Moon
Committed by Gerrit Code Review

Don't PNAT for DHCP packets

And don't call Neutron before the config is ready

Change-Id: I921731468c65b9df7646525d32edddc69e46c371
...@@ -27,6 +27,7 @@ import org.onlab.packet.Ethernet; ...@@ -27,6 +27,7 @@ import org.onlab.packet.Ethernet;
27 import org.onlab.packet.IPv4; 27 import org.onlab.packet.IPv4;
28 import org.onlab.packet.Ip4Address; 28 import org.onlab.packet.Ip4Address;
29 import org.onlab.packet.MacAddress; 29 import org.onlab.packet.MacAddress;
30 +import org.onlab.packet.UDP;
30 import org.onosproject.core.ApplicationId; 31 import org.onosproject.core.ApplicationId;
31 import org.onosproject.core.CoreService; 32 import org.onosproject.core.CoreService;
32 import org.onosproject.net.DeviceId; 33 import org.onosproject.net.DeviceId;
...@@ -112,7 +113,6 @@ public class OpenstackRoutingManager implements OpenstackRoutingService { ...@@ -112,7 +113,6 @@ public class OpenstackRoutingManager implements OpenstackRoutingService {
112 protected void activate() { 113 protected void activate() {
113 appId = coreService.registerApplication(APP_ID); 114 appId = coreService.registerApplication(APP_ID);
114 packetService.addProcessor(internalPacketProcessor, PacketProcessor.director(1)); 115 packetService.addProcessor(internalPacketProcessor, PacketProcessor.director(1));
115 - reloadInitL3Rules();
116 log.info("onos-openstackrouting started"); 116 log.info("onos-openstackrouting started");
117 } 117 }
118 118
...@@ -210,6 +210,13 @@ public class OpenstackRoutingManager implements OpenstackRoutingService { ...@@ -210,6 +210,13 @@ public class OpenstackRoutingManager implements OpenstackRoutingService {
210 case IPv4.PROTOCOL_ICMP: 210 case IPv4.PROTOCOL_ICMP:
211 icmpEventExecutorService.execute(new OpenstackIcmpHandler(rulePopulator, context)); 211 icmpEventExecutorService.execute(new OpenstackIcmpHandler(rulePopulator, context));
212 break; 212 break;
213 + case IPv4.PROTOCOL_UDP:
214 + // don't process DHCP
215 + UDP udpPacket = (UDP) iPacket.getPayload();
216 + if (udpPacket.getDestinationPort() == UDP.DHCP_SERVER_PORT &&
217 + udpPacket.getSourcePort() == UDP.DHCP_CLIENT_PORT) {
218 + break;
219 + }
213 default: 220 default:
214 int portNum = getPortNum(ethernet.getSourceMAC(), iPacket.getDestinationAddress()); 221 int portNum = getPortNum(ethernet.getSourceMAC(), iPacket.getDestinationAddress());
215 Port port = getExternalPort(pkt.receivedFrom().deviceId(), EXTERNAL_INTERFACE_NAME); 222 Port port = getExternalPort(pkt.receivedFrom().deviceId(), EXTERNAL_INTERFACE_NAME);
......