Enforce outbound parameter/capability length 95/80795/2
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 12 Mar 2019 12:30:26 +0000 (13:30 +0100)
committerRobert Varga <nite@hq.sk>
Tue, 12 Mar 2019 15:01:16 +0000 (15:01 +0000)
commit4ba2ab15dd45a6500252952db06a32428864b299
tree8ae41af347199d9a9ec3763e9eb39a3c08fa47f4
parentfda33d59b9ad3cef8561cc90f78eebd19f4d4d33
Enforce outbound parameter/capability length

Capability and Optional Parameter length fields are only single-byte
entities, limiting the size of capabilities to 255 bytes without
overflow.

Rather than emitting an invalid message, catch this error before
writeout so the operator may make adjustments to ensure this limit
is not exceeded.

JIRA: BGPCEP-867
Change-Id: Idecfcfa1e991aadbdf35cd221f9312dea0f6d0c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/BGPOpenMessageParser.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/ParameterUtil.java