diff options
author | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-06-02 20:25:58 +0900 |
---|---|---|
committer | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-06-02 21:09:04 +0900 |
commit | e985f476a182f1a66084b3ed4b1c2376f9cc5018 (patch) | |
tree | 91dfbaf8f5685bac44afad834cbf4c1d32b7c8c5 /table/destination_test.go | |
parent | 007c0df5092df0be2e03df457dcfcb89c92080d6 (diff) |
packet: return aspath length based on the segment type.
Diffstat (limited to 'table/destination_test.go')
-rw-r--r-- | table/destination_test.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/table/destination_test.go b/table/destination_test.go index 751c94db..f6005588 100644 --- a/table/destination_test.go +++ b/table/destination_test.go @@ -146,7 +146,9 @@ func updateMsgD1() *bgp.BGPMessage { nlri := []bgp.NLRInfo{*bgp.NewNLRInfo(24, "10.10.10.0")} withdrawnRoutes := []bgp.WithdrawnRoute{} - return bgp.NewBGPUpdateMessage(withdrawnRoutes, pathAttributes, nlri) + updateMsg := bgp.NewBGPUpdateMessage(withdrawnRoutes, pathAttributes, nlri) + UpdatePathAttrs4ByteAs(updateMsg.Body.(*bgp.BGPUpdate)) + return updateMsg } func updateMsgD2() *bgp.BGPMessage { @@ -166,7 +168,9 @@ func updateMsgD2() *bgp.BGPMessage { nlri := []bgp.NLRInfo{*bgp.NewNLRInfo(24, "20.20.20.0")} withdrawnRoutes := []bgp.WithdrawnRoute{} - return bgp.NewBGPUpdateMessage(withdrawnRoutes, pathAttributes, nlri) + updateMsg := bgp.NewBGPUpdateMessage(withdrawnRoutes, pathAttributes, nlri) + UpdatePathAttrs4ByteAs(updateMsg.Body.(*bgp.BGPUpdate)) + return updateMsg } func updateMsgD3() *bgp.BGPMessage { origin := bgp.NewPathAttributeOrigin(0) @@ -185,5 +189,7 @@ func updateMsgD3() *bgp.BGPMessage { nlri := []bgp.NLRInfo{*bgp.NewNLRInfo(24, "30.30.30.0")} w1 := bgp.WithdrawnRoute{*bgp.NewIPAddrPrefix(23, "40.40.40.0")} withdrawnRoutes := []bgp.WithdrawnRoute{w1} - return bgp.NewBGPUpdateMessage(withdrawnRoutes, pathAttributes, nlri) + updateMsg := bgp.NewBGPUpdateMessage(withdrawnRoutes, pathAttributes, nlri) + UpdatePathAttrs4ByteAs(updateMsg.Body.(*bgp.BGPUpdate)) + return updateMsg } |