summaryrefslogtreecommitdiffhomepage
path: root/packet/validate.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-03-05 22:48:49 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-03-05 22:48:49 +0900
commitaf7f4d5531f2116e01f36b99611ffdbcc19a8cdd (patch)
tree5167ba21a7157da964c35d491287459aef214eb3 /packet/validate.go
parent216e376c34ae38acaff3d01c22ce2eb2f1bc4a08 (diff)
config: validate route family configuraiton
If not specified, use the same AFI with peer IP address as a default. To avoid circular import, define BGP_ORIGIN_ATTR_TYPE consts bgp.go Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'packet/validate.go')
-rw-r--r--packet/validate.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/packet/validate.go b/packet/validate.go
index 143aefc9..b412ee8d 100644
--- a/packet/validate.go
+++ b/packet/validate.go
@@ -3,7 +3,6 @@ package bgp
import (
"encoding/binary"
"fmt"
- "github.com/osrg/gobgp/config"
"net"
"strconv"
)
@@ -104,9 +103,9 @@ func ValidateAttribute(a PathAttributeInterface, rfs []RouteFamily) (bool, error
}
case *PathAttributeOrigin:
v := uint8(p.Value[0])
- if v != config.BGP_ORIGIN_ATTR_TYPE_IGP &&
- v != config.BGP_ORIGIN_ATTR_TYPE_EGP &&
- v != config.BGP_ORIGIN_ATTR_TYPE_INCOMPLETE {
+ if v != BGP_ORIGIN_ATTR_TYPE_IGP &&
+ v != BGP_ORIGIN_ATTR_TYPE_EGP &&
+ v != BGP_ORIGIN_ATTR_TYPE_INCOMPLETE {
data, _ := a.Serialize()
eMsg := "invalid origin attribute. value : " + strconv.Itoa(int(v))
return false, NewMessageError(eCode, eSubCodeBadOrigin, data, eMsg)