diff --git a/src/bgp/bgp_proto.cc b/src/bgp/bgp_proto.cc index 646c4741c56..a6cd8dbeb7a 100644 --- a/src/bgp/bgp_proto.cc +++ b/src/bgp/bgp_proto.cc @@ -1148,10 +1148,13 @@ class BgpPathAttributeMpNlriNextHopLength : public ProtoElement { public: static const int kSize = 1; + static const int kErrorCode = BgpProto::Notification::UpdateMsgErr; + static const int kErrorSubcode = + BgpProto::Notification::OptionalAttribError; typedef int SequenceLength; static bool Verifier(const BgpMpNlri *obj, const uint8_t *data, size_t size, ParseContext *context) { - uint8_t len = data[0]; + uint8_t len = get_value(data, kSize); uint16_t afi = obj->afi; uint8_t safi = obj->safi; if (afi == BgpAf::IPv4 && safi == BgpAf::Unicast) {