gobgp: mrt inject should not add nexthop attribute

mrt dump file should include nexthop attribute

Signed-off-by: FUJITA Tomonori <[email protected]>
This commit is contained in:
FUJITA Tomonori
2015-08-29 12:41:12 +09:00
parent 46a99f289a
commit fddfcd9e42
-6
View File
@@ -280,15 +280,9 @@ func injectMrt(r string, filename string, count int) error {
fmt.Printf("invalid peer index: %d (PEER_INDEX_TABLE has only %d peers)\n", e.PeerIndex, len(peers))
os.Exit(1)
}
nexthop := peers[e.PeerIndex].IpAddress.String()
if rf == bgp.RF_IPv4_UC {
path.Nlri, _ = nlri.Serialize()
n, _ := bgp.NewPathAttributeNextHop(nexthop).Serialize()
path.Pattrs = append(path.Pattrs, n)
} else {
mpreach, _ := bgp.NewPathAttributeMpReachNLRI(nexthop, []bgp.AddrPrefixInterface{nlri}).Serialize()
path.Pattrs = append(path.Pattrs, mpreach)
}
for _, p := range e.PathAttributes {