diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-06-03 11:20:50 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-06-03 11:20:50 +0900 |
commit | b13c09baa66eaab822eb42bbf0a02fdbbf532932 (patch) | |
tree | 6842c796bd4384c6a1aef208b09b5d1a62b80170 /table/destination_test.go | |
parent | a3237877e024f44f96f02c83237cf614baf8bcd0 (diff) |
table: fix leftmostAS() in compareByMED
Needs the first AS in the AS_SEQUENCE is the same for multiple
paths. Any preceding AS_CONFED_SEQUENCE is ignored.
Also rename the function name to 'firstAS'.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/destination_test.go')
-rw-r--r-- | table/destination_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/table/destination_test.go b/table/destination_test.go index 690cfe6b..23458906 100644 --- a/table/destination_test.go +++ b/table/destination_test.go @@ -227,7 +227,7 @@ func TestMedTieBreaker(t *testing.T) { }() p1 := func() *Path { - aspath := bgp.NewPathAttributeAsPath([]bgp.AsPathParamInterface{bgp.NewAs4PathParam(bgp.BGP_ASPATH_ATTR_TYPE_SEQ, []uint32{65001, 65002}), bgp.NewAs4PathParam(bgp.BGP_ASPATH_ATTR_TYPE_SEQ, []uint32{65003, 65004})}) + aspath := bgp.NewPathAttributeAsPath([]bgp.AsPathParamInterface{bgp.NewAs4PathParam(bgp.BGP_ASPATH_ATTR_TYPE_SEQ, []uint32{65001, 65002}), bgp.NewAs4PathParam(bgp.BGP_ASPATH_ATTR_TYPE_SEQ, []uint32{65003, 65005})}) attrs := []bgp.PathAttributeInterface{aspath, bgp.NewPathAttributeMultiExitDisc(10)} return NewPath(nil, nlri, false, attrs, time.Now(), false) }() @@ -245,7 +245,7 @@ func TestMedTieBreaker(t *testing.T) { assert.Equal(t, compareByMED(p0, p2), (*Path)(nil)) p3 := func() *Path { - aspath := bgp.NewPathAttributeAsPath([]bgp.AsPathParamInterface{bgp.NewAs4PathParam(bgp.BGP_ASPATH_ATTR_TYPE_SEQ, []uint32{65001, 65002}), bgp.NewAs4PathParam(bgp.BGP_ASPATH_ATTR_TYPE_CONFED_SEQ, []uint32{65003, 65004})}) + aspath := bgp.NewPathAttributeAsPath([]bgp.AsPathParamInterface{bgp.NewAs4PathParam(bgp.BGP_ASPATH_ATTR_TYPE_CONFED_SEQ, []uint32{65003, 65004}), bgp.NewAs4PathParam(bgp.BGP_ASPATH_ATTR_TYPE_SEQ, []uint32{65001, 65003})}) attrs := []bgp.PathAttributeInterface{aspath, bgp.NewPathAttributeMultiExitDisc(0)} return NewPath(nil, nlri, false, attrs, time.Now(), false) }() |