Uploaded image for project: 'bgpcep'
  1. bgpcep
  2. BGPCEP-659

IPv6 prefix read error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Bugzilla Migration
    • Bugzilla Migration
    • BGP
    • None
    • Operating System: All
      Platform: All

    • 8252

      IPv6 prefix is not parsed correctly. The expected prefix length is 16 bytes. However, the read length is -16 bytes. It is due to the utility method doesn't convert the length byte into unsigned value.

      To reproduce this problem, just try to advertise a IPv6 unicast route to the controller with prefix length 128.

      The similar problem may happen to IPv4 as well upon checking the code.

      2017-04-14 17:58:52,539 | ERROR | ntLoopGroup-11-1 | BGPDocumentedException | 346 - org.opendaylight.bgpcep.bgp-parser-api - 0.6.1.Boron-SR1 | Error = MALFORMED_ATTR_LIST
      org.opendaylight.protocol.bgp.parser.BGPDocumentedException: Could not parse BGP attributes.
      at org.opendaylight.protocol.bgp.parser.impl.message.BGPUpdateMessageParser.parseMessageBody(BGPUpdateMessageParser.java:135)[348:org.opendaylight.bgpcep.bgp-parser-impl:0.6.1.Boron-SR1]
      at org.opendaylight.protocol.bgp.parser.impl.message.BGPUpdateMessageParser.parseMessageBody(BGPUpdateMessageParser.java:46)[348:org.opendaylight.bgpcep.bgp-parser-impl:0.6.1.Boron-SR1]
      at org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleMessageRegistry.parseBody(SimpleMessageRegistry.java:31)[347:org.opendaylight.bgpcep.bgp-parser-spi:0.6.1.Boron-SR1]
      at org.opendaylight.protocol.bgp.parser.spi.AbstractMessageRegistry.parseMessage(AbstractMessageRegistry.java:66)[347:org.opendaylight.bgpcep.bgp-parser-spi:0.6.1.Boron-SR1]
      at org.opendaylight.protocol.bgp.rib.impl.BGPByteToMessageDecoder.decode(BGPByteToMessageDecoder.java:49)[360:org.opendaylight.bgpcep.bgp-rib-impl:0.6.1.Boron-SR1]
      at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)[114:io.netty.codec:4.0.37.Final]
      at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)[114:io.netty.codec:4.0.37.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)[113:io.netty.transport:4.0.37.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)[113:io.netty.transport:4.0.37.Final]
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:321)[113:io.netty.transport:4.0.37.Final]
      at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)[114:io.netty.codec:4.0.37.Final]
      at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:280)[114:io.netty.codec:4.0.37.Final]
      at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:396)[114:io.netty.codec:4.0.37.Final]
      at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)[114:io.netty.codec:4.0.37.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)[113:io.netty.transport:4.0.37.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)[113:io.netty.transport:4.0.37.Final]
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:321)[113:io.netty.transport:4.0.37.Final]
      at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1280)[113:io.netty.transport:4.0.37.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)[113:io.netty.transport:4.0.37.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)[113:io.netty.transport:4.0.37.Final]
      at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:890)[113:io.netty.transport:4.0.37.Final]
      at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:879)[117:io.netty.transport-native-epoll:4.0.37.Final]
      at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:387)[117:io.netty.transport-native-epoll:4.0.37.Final]
      at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:303)[117:io.netty.transport-native-epoll:4.0.37.Final]
      at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)[112:io.netty.common:4.0.37.Final]
      at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:145)[112:io.netty.common:4.0.37.Final]
      at java.lang.Thread.run(Thread.java:745)[:1.8.0_101]
      Caused by: java.lang.IllegalStateException: NLRI length read from message doesn't match. Length expected (read from NLRI) is 1537, length readable is 1296
      at com.google.common.base.Preconditions.checkState(Preconditions.java:197)[39:com.google.guava:18.0.0]
      at org.opendaylight.protocol.bgp.flowspec.AbstractFlowspecNlriParser.verifyNlriLength(AbstractFlowspecNlriParser.java:608)[361:org.opendaylight.bgpcep.bgp-flowspec:0.6.1.Boron-SR1]
      at org.opendaylight.protocol.bgp.flowspec.AbstractFlowspecNlriParser.parseNlri(AbstractFlowspecNlriParser.java:629)[361:org.opendaylight.bgpcep.bgp-flowspec:0.6.1.Boron-SR1]
      at org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleNlriRegistry.parseMpReach(SimpleNlriRegistry.java:239)[347:org.opendaylight.bgpcep.bgp-parser-spi:0.6.1.Boron-SR1]
      at org.opendaylight.protocol.bgp.parser.impl.message.update.MPReachAttributeParser.parseAttribute(MPReachAttributeParser.java:49)[348:org.opendaylight.bgpcep.bgp-parser-impl:0.6.1.Boron-SR1]
      at org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleAttributeRegistry.parseAttributes(SimpleAttributeRegistry.java:138)[347:org.opendaylight.bgpcep.bgp-parser-spi:0.6.1.Boron-SR1]
      at org.opendaylight.protocol.bgp.parser.impl.message.BGPUpdateMessageParser.parseMessageBody(BGPUpdateMessageParser.java:131)[348:org.opendaylight.bgpcep.bgp-parser-impl:0.6.1.Boron-SR1]
      ... 26 more
      2017-04-14 17:58:52,541 | WARN | ntLoopGroup-11-1 | BGPSessionImpl | 360 - org.opendaylight.bgpcep.bgp-rib-impl - 0.6.1.Boron-SR1 | BGP session encountered error

            kevinxw Kevin Wang
            kevinxw Kevin Wang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: