Details
-
Bug
-
Status: Resolved
-
Resolution: Done
-
None
-
None
-
None
-
Operating System: All
Platform: All
-
1713
Description
This issue was originally reported in OPNFLWPLUG-222.
When a controller with the OF plugin connected to a OpenFlow 1.0 switch and I tried to install a flow entry with push-vlan action into the switch, NullPointerException occurred.
It seems that OF plugin does not correctly ignore push-vlan action.
(We think that ignoring push-vlan action against OF 1.0 switch is ok, but the way to ignore is not correct.)
Due to this issue, VTN Manager failed to create a flow entry.
I used the latest code on September 2nd, 2014.
You can reproduce this issue using RESTCONF API.
URL: http://192.168.2.56:8080/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/9
Method: PUT
Body:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flow xmlns="urn:opendaylight:flow:inventory">
<priority>29</priority>
<flow-name>Foo8</flow-name>
<match>
<ethernet-match>
<ethernet-type>
<type>2048</type>
</ethernet-type>
</ethernet-match>
<ipv4-destination>10.0.10.9/24</ipv4-destination>
</match>
<id>9</id>
<table_id>0</table_id>
<instructions>
<instruction>
<order>0</order>
<apply-actions>
<action>
<order>0</order>
<push-vlan-action>
<vlan-id>156</vlan-id>
<ethernet-type>33024</ethernet-type>
</push-vlan-action>
</action>
</apply-actions>
</instruction>
</instructions>
</flow>
The output what I saw:
2014-09-02 22:13:08.662 EDT [nioEventLoopGroup-11-1] WARN o.o.o.protocol.impl.core.OFEncoder - Message serialization failed
java.lang.NullPointerException: null
at org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMakerFactory$2.make(TypeKeyMakerFactory.java:64) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMakerFactory$2.make(TypeKeyMakerFactory.java:61) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.util.ListSerializer.serializeList(ListSerializer.java:38) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10FlowModInputMessageFactory.serialize(OF10FlowModInputMessageFactory.java:52) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10FlowModInputMessageFactory.serialize(OF10FlowModInputMessageFactory.java:31) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.serialization.SerializationFactory.messageToBuffer(SerializationFactory.java:36) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.core.OFEncoder.encode(OFEncoder.java:41) [bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.core.OFEncoder.encode(OFEncoder.java:26) [bundlefile:na]
at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:111) [bundlefile:4.0.19.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:666) [bundlefile:4.0.19.Final]
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:724) [bundlefile:4.0.19.Final]
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:659) [bundlefile:4.0.19.Final]
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:645) [bundlefile:4.0.19.Final]
at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:878) [bundlefile:4.0.19.Final]
at io.netty.channel.AbstractChannel.write(AbstractChannel.java:231) [bundlefile:4.0.19.Final]
at org.opendaylight.openflowjava.protocol.impl.connection.ChannelOutboundQueue.flush(ChannelOutboundQueue.java:189) [bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.connection.ChannelOutboundQueue.access$000(ChannelOutboundQueue.java:40) [bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.connection.ChannelOutboundQueue$1.run(ChannelOutboundQueue.java:84) [bundlefile:na]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:341) [bundlefile:4.0.19.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346) [bundlefile:4.0.19.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [bundlefile:4.0.19.Final]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_65]
When I applied the following patch, the above NPE didn't occur.
diff --git a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/ActionConvertor.java b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/ActionConvertor.java
index 4938e41..541ef92 100644
— a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/ActionConvertor.java
+++ b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/ActionConvertor.java
@@ -359,7 +359,7 @@ public final class ActionConvertor {
if (version == OFConstants.OFP_VERSION_1_0)
PushVlanActionCase pushVlanActionCase = (PushVlanActionCase) action;