[BGPCEP-233] Message decoder fails to decode "all IP addresses match this update" UPDATE messages Created: 04/Jun/15  Updated: 03/Mar/19  Resolved: 09/Jun/15

Status: Resolved
Project: bgpcep
Component/s: BGP
Affects Version/s: Bugzilla Migration
Fix Version/s: Bugzilla Migration

Type: Bug
Reporter: Jozef Behran Assignee: Ladislav Borak
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File report.txt    
External issue ID: 3577
Priority: High

 Description   

If an UPDATE message states in its NLRI that "all IP addresses match" (this is done by specifying a prefix with length=0 and no value, see RFC 4271, section "Network Layer Reachability Information", subsection "a) Length"), the following exception is logged:

2015-06-04 10:00:33,604 | WARN | oupCloseable-3-4 | DefaultChannelPipeline | 149 - io.netty.common - 4.0.26.Final | An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
io.netty.handler.codec.DecoderException: java.lang.IllegalArgumentException: Cannot create subByte, invalid arguments: Length: 0 startIndex: 1
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:346)[174:io.netty.codec:4.0.26.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:229)[174:io.netty.codec:4.0.26.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)[148:io.netty.transport:4.0.26.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)[148:io.netty.transport:4.0.26.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)[174:io.netty.codec:4.0.26.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)[148:io.netty.transport:4.0.26.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)[148:io.netty.transport:4.0.26.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)[148:io.netty.transport:4.0.26.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)[148:io.netty.transport:4.0.26.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)[148:io.netty.transport:4.0.26.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)[148:io.netty.transport:4.0.26.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)[148:io.netty.transport:4.0.26.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)[148:io.netty.transport:4.0.26.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)[149:io.netty.common:4.0.26.Final]
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)[149:io.netty.common:4.0.26.Final]
at java.lang.Thread.run(Unknown Source)[:1.7.0_67]
Caused by: java.lang.IllegalArgumentException: Cannot create subByte, invalid arguments: Length: 0 startIndex: 1
at org.opendaylight.protocol.util.ByteArray.subByte(ByteArray.java:99)[246:org.opendaylight.bgpcep.util:0.4.0.SNAPSHOT]
at org.opendaylight.protocol.util.Ipv4Util.prefixListForBytes(Ipv4Util.java:173)[246:org.opendaylight.bgpcep.util:0.4.0.SNAPSHOT]
at org.opendaylight.protocol.bgp.parser.impl.message.BGPUpdateMessageParser.parseMessageBody(BGPUpdateMessageParser.java:92)[252:org.opendaylight.bgpcep.bgp-parser-impl:0.4.0.SNAPSHOT]
at org.opendaylight.protocol.bgp.parser.impl.message.BGPUpdateMessageParser.parseMessageBody(BGPUpdateMessageParser.java:42)[252:org.opendaylight.bgpcep.bgp-parser-impl:0.4.0.SNAPSHOT]
at org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleMessageRegistry.parseBody(SimpleMessageRegistry.java:31)[251:org.opendaylight.bgpcep.bgp-parser-spi:0.4.0.SNAPSHOT]
at org.opendaylight.protocol.bgp.parser.spi.AbstractMessageRegistry.parseMessage(AbstractMessageRegistry.java:59)[251:org.opendaylight.bgpcep.bgp-parser-spi:0.4.0.SNAPSHOT]
at org.opendaylight.protocol.bgp.rib.impl.BGPByteToMessageDecoder.decode(BGPByteToMessageDecoder.java:41)[259:org.opendaylight.bgpcep.bgp-rib-impl:0.4.0.SNAPSHOT]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:315)[174:io.netty.codec:4.0.26.Final]
... 15 more

I have no idea what happens to the message after this exception occurs.



 Comments   
Comment by Jozef Behran [ 04/Jun/15 ]

Attachment report.txt has been added with description: Section of TRACE log from the offending message received to the exception described in the description.

Comment by Ladislav Borak [ 05/Jun/15 ]

proposed patch:

https://git.opendaylight.org/gerrit/#/c/21979/1

Comment by Dana Kutenicsova [ 08/Jun/15 ]

https://git.opendaylight.org/gerrit/22067

Generated at Wed Feb 07 19:12:25 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.