diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-05-10 14:42:38 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-05-10 23:13:21 +0900 |
commit | 2b0f16dcc6a47bd8d6518746038b3d65ff55e8c4 (patch) | |
tree | 7678378a940b6be7c8ad150362ded0464637c0e3 /server/mrt.go | |
parent | 691d80e5d160b82c8b4dd1d83c959ecdffad318f (diff) |
bmp: avoid huge memory allocation for sending paths initially
We had to serialize all the paths once because the paths could be
modified later. Now they are immutable so we don't need.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/mrt.go')
-rw-r--r-- | server/mrt.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/server/mrt.go b/server/mrt.go index fe61f7a1..613f0b07 100644 --- a/server/mrt.go +++ b/server/mrt.go @@ -88,6 +88,9 @@ func (m *mrtWriter) loop() error { msg := make([]*mrt.MRTMessage, 0, 1) switch e := ev.(type) { case *WatchEventUpdate: + if e.Init { + return nil + } mp := mrt.NewBGP4MPMessage(e.PeerAS, e.LocalAS, 0, e.PeerAddress.String(), e.LocalAddress.String(), e.FourBytesAs, nil) mp.BGPMessagePayload = e.Payload isAddPath := e.Neighbor.IsAddPathReceiveEnabled(e.PathList[0].GetRouteFamily()) |