[BGPCEP-662] Unable to parse flowspec BGP UPDATE when there are multiple NLRI in one message Created: 24/Apr/17  Updated: 03/Mar/19  Resolved: 26/Jun/17

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

Type: Bug
Reporter: Kevin Wang Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 8292

 Description   

When there are more than one NLRI batched in one BGP UPDATE message, the NLRI length byte cannot be parsed correctly.

The NLRI length byte should be read for every NLRI. However, right now it's only read for the first NLRI.

Caused by: org.opendaylight.protocol.bgp.parser.BGPDocumentedException: Could not parse BGP attributes.
at org.opendaylight.protocol.bgp.parser.impl.message.BGPUpdateMessageParser.parseMessageBody(BGPUpdateMessageParser.java:135)[349:org.opendaylight.bgpcep.bgp-parser-impl:0.6.1.Boron-SR1]
at org.opendaylight.protocol.bgp.parser.impl.message.BGPUpdateMessageParser.parseMessageBody(BGPUpdateMessageParser.java:46)[349:org.opendaylight.bgpcep.bgp-parser-impl:0.6.1.Boron-SR1]
at org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleMessageRegistry.parseBody(SimpleMessageRegistry.java:31)[348:org.opendaylight.bgpcep.bgp-parser-spi:0.6.1.Boron-SR1]
at org.opendaylight.protocol.bgp.parser.spi.AbstractMessageRegistry.parseMessage(AbstractMessageRegistry.java:66)[348:org.opendaylight.bgpcep.bgp-parser-spi:0.6.1.Boron-SR1]
at org.opendaylight.protocol.bgp.rib.impl.BGPByteToMessageDecoder.decode(BGPByteToMessageDecoder.java:49)[361: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]
... 21 more
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)[362:org.opendaylight.bgpcep.bgp-flowspec:0.6.1.Boron-SR1]
at org.opendaylight.protocol.bgp.flowspec.AbstractFlowspecNlriParser.parseNlri(AbstractFlowspecNlriParser.java:629)[362:org.opendaylight.bgpcep.bgp-flowspec:0.6.1.Boron-SR1]
at org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleNlriRegistry.parseMpReach(SimpleNlriRegistry.java:239)[348: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)[349:org.opendaylight.bgpcep.bgp-parser-impl:0.6.1.Boron-SR1]
at org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleAttributeRegistry.parseAttributes(SimpleAttributeRegistry.java:138)[348:org.opendaylight.bgpcep.bgp-parser-spi:0.6.1.Boron-SR1]
at org.opendaylight.protocol.bgp.parser.impl.message.BGPUpdateMessageParser.parseMessageBody(BGPUpdateMessageParser.java:131)[349:org.opendaylight.bgpcep.bgp-parser-impl:0.6.1.Boron-SR1]



 Comments   
Comment by Kevin Wang [ 24/Apr/17 ]

Sample Flowspec packet hex:

060120d83af565060120d83adac4060120d83ad8c3060120d83ad864060120d83ad824060120d05abcc6060120c665a255060120c0004f21060120c0004f20060120bfefd5c5060120be5dfd50060120be5dfc50060120b848da26060120adc22e7f060120adc22e78060120adc22e77060120adc22e74060120adc22e73060120adc22e72060120adc22e71060120adc22e70060120adc22e6f060120a2fefadf060120a1060b0606012094422a6406012094422a6306012094422a6206012094422a6106012094422a6006012094422a5f06012094422a5e06012094422a5d06012094422a5c06012094422a5b06012094422a5a06012094422a5906012094422a5806012094422a5706012094422a5606012094422a5506012094422a5406012094422a5306012094422a5106012094422a5006012094422a4f06012094422a4e06012094422a4d06012094422a4c06012094422a4b06012094422a4a06012094422a4906012094422a4806012094422a4706012094422a4606012094422a4506012094422a4406012094422a4306012094422a4206012094422a4106012094422a4006012094422a3f06012094422a3e06012094422a3d06012094422a3c06012094422a3b06012094422a3a06012094422a3906012094422a3806012094422a3706012094422a3606012094422a3506012094422a3406012094422a3306012094422a3206012094422a3106012094422a3006012094422a2f06012094422a2e06012094422a2d06012094422a2c06012094422a2b06012094422a2a06012094422a2906012094422a2806012094422a2706012094422a2606012094422a2506012094422a2406012094422a2306012094422a2206012094422a2106012094422a2006012094422a1f06012094422a1e06012094422a1d06012094422a1c06012094422a1b06012094422a1a06012094422a1906012094422a1806012094422a1706012094422a1506012094422a1406012094422a1306012094422a1206012094422a1106012094422a1006012094422a0f06012094422a0e06012094422a0d06012094422a0c06012094422a0b06012094422a0a06012094422a0906012094422a0806012094422a0706012094422a0606012094422a0506012094422a0406012094422a0306012094422a0206012094422a01060120944204520601209442041606012090064d0606012090064d0506012087010201060120820e106e0601207d09290206012073403715060120734037020601206b149e7e060120682bc3fb0601206828d323060120681c177d06012067135b900601206011aa210601206011aa1b06012060110a3106012060110a2206012060110a1b06012060110a1a06012060110a1206012060110a080601204a7d8d6a0601204a7d8d690601204a7d8d680601204a7d8d670601204a7d8d630601204a7d158406012042872e9e060120425e0337060120417a060106012041240102060120402c0108060120402c0107060120402c0106060120402c0105060120402c0104060120402c0103060120402c0102060120402c010106012036f3710506012036bf77b20601203423e90e060120313130060601203131300506012031313003060120313130010601203005060906012017eb2e4906012017eb284906012017dd069606012017dcfd5806012017dcf8660601201765c48d06012017647aaf0601201760343506012017490df40601201748e1380601201748e1280601201748e0c00601201748e0880601201748e0810601201748e080020100

Comment by Kevin Wang [ 26/Jun/17 ]

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

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