diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-03-06 15:36:21 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-03-06 15:36:21 +0900 |
commit | a085ce2d338e9a79b98d0f9ea24c5b80bccdf0e1 (patch) | |
tree | 8bbb9d6b0d8866f20f411f60943344ab241ae202 /packet/validate.go | |
parent | ea6446b4ef6e461837ed4f94216fe4fadf2964fa (diff) |
server: check route refresh afi and safi
If it's not valid, log a warning and ignore.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'packet/validate.go')
-rw-r--r-- | packet/validate.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packet/validate.go b/packet/validate.go index b412ee8d..80d51a9e 100644 --- a/packet/validate.go +++ b/packet/validate.go @@ -76,7 +76,7 @@ func ValidateAttribute(a PathAttributeInterface, rfs []RouteFamily) (bool, error checkPrefix := func(l []AddrPrefixInterface) bool { for _, prefix := range l { - rf := rfshift(prefix.AFI(), prefix.SAFI()) + rf := AfiSafiToRouteFamily(prefix.AFI(), prefix.SAFI()) if isRfSupported(rf, rfs) == false { return false } @@ -86,7 +86,7 @@ func ValidateAttribute(a PathAttributeInterface, rfs []RouteFamily) (bool, error switch p := a.(type) { case *PathAttributeMpUnreachNLRI: - rf := rfshift(p.AFI, p.SAFI) + rf := AfiSafiToRouteFamily(p.AFI, p.SAFI) if isRfSupported(rf, rfs) == false { return false, NewMessageError(0, 0, nil, fmt.Sprintf("Address-family rf %d not avalible for session", rf)) } @@ -94,7 +94,7 @@ func ValidateAttribute(a PathAttributeInterface, rfs []RouteFamily) (bool, error return false, NewMessageError(0, 0, nil, fmt.Sprintf("Address-family rf %d not avalible for session", rf)) } case *PathAttributeMpReachNLRI: - rf := rfshift(p.AFI, p.SAFI) + rf := AfiSafiToRouteFamily(p.AFI, p.SAFI) if isRfSupported(rf, rfs) == false { return false, NewMessageError(0, 0, nil, fmt.Sprintf("Address-family rf %d not avalible for session", rf)) } |