summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp/bgp_test.go
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2018-03-22 16:24:46 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-04-03 08:32:46 +0900
commita381f1b60b879c245b0bb37fe65fd5c7b7be1f56 (patch)
treeea7a8e8a4241d7f880ce1515fe79fe9495eac7d5 /packet/bgp/bgp_test.go
parent752cec366b9adf0fae6b98aabbd7cd8aacfca492 (diff)
packet/bgp: Remove length argument from NewEVPNNLRI
The length value can be retrieved from the route type specific data field and need not to be specified at the initialization. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'packet/bgp/bgp_test.go')
-rw-r--r--packet/bgp/bgp_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/packet/bgp/bgp_test.go b/packet/bgp/bgp_test.go
index 248fb346..65847b55 100644
--- a/packet/bgp/bgp_test.go
+++ b/packet/bgp/bgp_test.go
@@ -585,7 +585,7 @@ func Test_EVPNIPPrefixRoute(t *testing.T) {
GWIPAddress: net.IP{10, 10, 10, 10},
Label: 1000,
}
- n1 := NewEVPNNLRI(EVPN_IP_PREFIX, 0, r)
+ n1 := NewEVPNNLRI(EVPN_IP_PREFIX, r)
buf1, err := n1.Serialize()
assert.Nil(err)
n2, err := NewPrefixFromRouteFamily(RouteFamilyToAfiSafi(RF_EVPN))
@@ -722,13 +722,13 @@ func Test_AddPath(t *testing.T) {
}
opt = &MarshallingOption{AddPath: map[RouteFamily]BGPAddPathMode{RF_EVPN: BGP_ADD_PATH_BOTH}}
{
- n1 := NewEVPNNLRI(EVPN_ROUTE_TYPE_ETHERNET_AUTO_DISCOVERY, 0,
+ n1 := NewEVPNNLRI(EVPN_ROUTE_TYPE_ETHERNET_AUTO_DISCOVERY,
&EVPNEthernetAutoDiscoveryRoute{NewRouteDistinguisherFourOctetAS(5, 6),
EthernetSegmentIdentifier{ESI_ARBITRARY, make([]byte, 9)}, 2, 2})
n1.SetPathLocalIdentifier(40)
bits, err := n1.Serialize(opt)
assert.Nil(err)
- n2 := NewEVPNNLRI(0, 0, nil)
+ n2 := NewEVPNNLRI(0, nil)
err = n2.DecodeFromBytes(bits, opt)
assert.Nil(err)
assert.Equal(n2.PathIdentifier(), uint32(40))