Committed by
Gerrit Code Review
[ONOS-4172] Issue fixed to process specific packets in SFC manager
Change-Id: Ib5cb6006b42a6b163b85fe89f725002336442baf
Showing
1 changed file
with
6 additions
and
2 deletions
... | @@ -539,7 +539,7 @@ public class SfcManager implements SfcService { | ... | @@ -539,7 +539,7 @@ public class SfcManager implements SfcService { |
539 | @Override | 539 | @Override |
540 | public void process(PacketContext context) { | 540 | public void process(PacketContext context) { |
541 | Ethernet packet = context.inPacket().parsed(); | 541 | Ethernet packet = context.inPacket().parsed(); |
542 | - if (packet == null) { | 542 | + if (packet == null || portChainService.getPortChainCount() == 0) { |
543 | return; | 543 | return; |
544 | } | 544 | } |
545 | // get the five tuple parameters for the packet | 545 | // get the five tuple parameters for the packet |
... | @@ -565,12 +565,16 @@ public class SfcManager implements SfcService { | ... | @@ -565,12 +565,16 @@ public class SfcManager implements SfcService { |
565 | UDP udpPacket = (UDP) ipv4Packet.getPayload(); | 565 | UDP udpPacket = (UDP) ipv4Packet.getPayload(); |
566 | portSrc = udpPacket.getSourcePort(); | 566 | portSrc = udpPacket.getSourcePort(); |
567 | portDst = udpPacket.getDestinationPort(); | 567 | portDst = udpPacket.getDestinationPort(); |
568 | + } else if (protocol == IPv4.PROTOCOL_ICMP) { | ||
569 | + // do nothing | ||
570 | + } else { | ||
571 | + // No need to process other packets received by controller. | ||
572 | + return; | ||
568 | } | 573 | } |
569 | } else if (ethType == Ethernet.TYPE_IPV6) { | 574 | } else if (ethType == Ethernet.TYPE_IPV6) { |
570 | return; | 575 | return; |
571 | } | 576 | } |
572 | 577 | ||
573 | - | ||
574 | FiveTuple fiveTuple = DefaultFiveTuple.builder() | 578 | FiveTuple fiveTuple = DefaultFiveTuple.builder() |
575 | .setIpSrc(ipSrc) | 579 | .setIpSrc(ipSrc) |
576 | .setIpDst(ipDst) | 580 | .setIpDst(ipDst) | ... | ... |
-
Please register or login to post a comment