Skip to content
Snippets Groups Projects
Unverified Commit f6c2783b authored by takt's avatar takt Committed by GitHub
Browse files

Merge pull request #20 from hikhvar/fix/compare-also-next-hop

Compare also next hop
parents 1e819039 22f1f213
No related branches found
No related tags found
No related merge requests found
......@@ -77,6 +77,14 @@ func (b *BGPPath) Compare(c *BGPPath) int8 {
return -1
}
if c.NextHop < b.NextHop {
return 1
}
if c.NextHop > b.NextHop {
return -1
}
return 0
}
......@@ -132,10 +140,6 @@ func (b *BGPPath) better(c *BGPPath) bool {
return false
}
func (b *BGPPath) ecmp(c *BGPPath) bool {
return b.LocalPref == c.LocalPref && b.ASPathLen == c.ASPathLen && b.Origin == c.Origin && b.MED == c.MED
}
func (b *BGPPath) Print() string {
origin := ""
switch b.Origin {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment