summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-29 23:49:18 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-29 23:49:18 +0900
commitbf9e7d83896775728cd89a54e81f0fede9e0ac2f (patch)
tree5a78ba4ca533922599e0d92394bd19ccf97b5da8
parenteffb32153615fc6521a9f43fb637b6c925773281 (diff)
packet: fix as_path parser
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--packet/bgp.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/packet/bgp.go b/packet/bgp.go
index dc32d45a..7c218103 100644
--- a/packet/bgp.go
+++ b/packet/bgp.go
@@ -1345,7 +1345,7 @@ func (p *DefaultAsPath) isValidAspath(data []byte) (bool, error) {
if asNum == 0 || int(asNum) > math.MaxUint8 {
return false, NewMessageError(eCode, eSubCode, nil, "AS PATH the number of AS is incorrect")
}
- segLength := asNum
+ segLength := int(asNum)
if use4byte == true {
segLength *= 4
} else {
@@ -1367,7 +1367,7 @@ func (p *DefaultAsPath) isValidAspath(data []byte) (bool, error) {
if err == nil {
return false, nil
}
- return false, NewMessageError(eCode, eSubCode, nil, "can't not parse")
+ return false, NewMessageError(eCode, eSubCode, nil, "==== can't not parse")
}
type AsPathParamInterface interface {