X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fprotocol_plugins%2Fopenflow%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fprotocol_plugin%2Fopenflow%2Finternal%2FFlowProgrammerService.java;h=d473a462c410332781b906c743804bca54d3da8a;hb=refs%2Fchanges%2F56%2F256%2F1;hp=4d3dca187863d5943b69a06e8f2cf8c88e2aa11f;hpb=752d1c2dd164f5789a9197b3718dc790c02fec73;p=controller.git diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowProgrammerService.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowProgrammerService.java index 4d3dca1878..d473a462c4 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowProgrammerService.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowProgrammerService.java @@ -445,7 +445,20 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService, xid = errorMsg.getXid(); } - long rid = getMessageRid(sw.getId(), xid); + Long rid = getMessageRid(sw.getId(), xid); + /* + * Null or zero requestId indicates that the error message is meant for + * a sync message. It will be handled by the sync message worker thread. + * Hence we are done here. + */ + if ((rid == null) || (rid == 0)) { + return; + } + + /* + * Notifies the caller that error has been reported for a previous flow + * programming request + */ for (Map.Entry containerNotifier : flowProgrammerNotifiers .entrySet()) { IFlowProgrammerNotifier notifier = containerNotifier.getValue(); @@ -585,10 +598,14 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService, * The OF message xid * @return The Request ID */ - public long getMessageRid(long swid, int xid) { + private Long getMessageRid(long swid, Integer xid) { + Long rid = null; + + if (xid == null) { + return rid; + } + Map swxid2rid = this.xid2rid.get(swid); - long rid = 0; - if (swxid2rid != null) { rid = swxid2rid.get(xid); }