Codepoint 255 is claimed by draft-ietf-idr-ext-opt-param and needs
special treatment. Do not allow it to be registered.
Change-Id: I0cdd8f95569ce1b48796c4552b2c90379aa34873
JIRA: BGPCEP-868
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
277c1c45836ad69d70b33e27a376bfea7312dd6e)
private final HandlerRegistry<DataContainer, ParameterParser, ParameterSerializer> handlers = new HandlerRegistry<>();
AutoCloseable registerParameterParser(final int messageType, final ParameterParser parser) {
- Preconditions.checkArgument(messageType >= 0 && messageType <= Values.UNSIGNED_BYTE_MAX_VALUE);
+ // 255 is explicitly excluded because it is handled in OPEN message parser
+ Preconditions.checkArgument(messageType >= 0 && messageType < Values.UNSIGNED_BYTE_MAX_VALUE);
return this.handlers.registerParser(messageType, parser);
}