diff options
-rw-r--r-- | packet/validate.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packet/validate.go b/packet/validate.go index b79012fc..3da96387 100644 --- a/packet/validate.go +++ b/packet/validate.go @@ -156,8 +156,8 @@ func ValidateFlags(t BGPAttrType, flags BGPAttrFlag) (bool, string) { // check flags are correct if f, ok := pathAttrFlags[t]; ok { - if f != BGPAttrFlag(uint8(flags) & ^uint8(BGP_ATTR_FLAG_EXTENDED_LENGTH)) { - eMsg := fmt.Sprintf("flags are invalid. attribute type: %d, expect: %s, actual: %s", t, f, flags) + if f != flags & ^BGP_ATTR_FLAG_EXTENDED_LENGTH & ^BGP_ATTR_FLAG_PARTIAL { + eMsg := fmt.Sprintf("flags are invalid. attribute type: %s, expect: %s, actual: %s", t, f, flags) return false, eMsg } } |