summaryrefslogtreecommitdiffhomepage
path: root/packet/mrt/mrt.go
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2017-07-31 10:00:35 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-10-03 23:04:20 +0900
commit21ac7fa3ca69ff95b6fab96245d8c03612ee56eb (patch)
tree66087056f7fd5974d138102d1e46a1a08bfda128 /packet/mrt/mrt.go
parente1d2dd025de89dd0c5db88322f990d60e09cc91f (diff)
packet/mrt: Enable RibEntry to switch add-path enabled
Because path_id = 0 is valid Path ID, we cannot determine whether add-path is enabled based on just a value of path_id. This patch adds a new argument to switch add-path features. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'packet/mrt/mrt.go')
-rw-r--r--packet/mrt/mrt.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/packet/mrt/mrt.go b/packet/mrt/mrt.go
index 559455d1..1b7c3e05 100644
--- a/packet/mrt/mrt.go
+++ b/packet/mrt/mrt.go
@@ -431,13 +431,13 @@ func (e *RibEntry) Serialize() ([]byte, error) {
return buf, nil
}
-func NewRibEntry(index uint16, time uint32, pathid uint32, pathattrs []bgp.PathAttributeInterface) *RibEntry {
+func NewRibEntry(index uint16, time uint32, pathId uint32, pathAttrs []bgp.PathAttributeInterface, isAddPath bool) *RibEntry {
return &RibEntry{
PeerIndex: index,
OriginatedTime: time,
- PathIdentifier: pathid,
- PathAttributes: pathattrs,
- isAddPath: pathid != 0,
+ PathIdentifier: pathId,
+ PathAttributes: pathAttrs,
+ isAddPath: isAddPath,
}
}