Fixed Findbugs issues in forwarding and arp modules
Change-Id: I25582ed3ea49848d77f88229303a964c510e578b
diff --git a/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java b/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java
index 4691149..017b260 100644
--- a/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java
+++ b/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java
@@ -434,6 +434,9 @@
@Override
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
+ if (!(msg instanceof OFPacketIn)) {
+ return Command.CONTINUE;
+ }
OFPacketIn pi = (OFPacketIn) msg;
@@ -642,10 +645,17 @@
byte[] senderIPAddress = zeroIpv4;
Interface intf = configService.getOutgoingInterface(ipAddress);
- if (intf != null) {
- senderIPAddress = intf.getIpAddress().getAddress();
+ if (intf == null) {
+ // TODO handle the case where the controller needs to send an ARP
+ // request but there's not IP configuration. In this case the
+ // request should be broadcast out all edge ports in the network.
+ log.warn("Sending ARP requests with default configuration "
+ + "not supported");
+ return;
}
+ senderIPAddress = intf.getIpAddress().getAddress();
+
arpRequest.setSenderProtocolAddress(senderIPAddress);
Ethernet eth = new Ethernet();