diff options
Diffstat (limited to 'table/path.go')
-rw-r--r-- | table/path.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/table/path.go b/table/path.go index 699c22e7..3f7be757 100644 --- a/table/path.go +++ b/table/path.go @@ -88,6 +88,8 @@ type Path struct { dels []bgp.BGPAttrType filtered map[string]PolicyDirection VrfIds []uint16 + // For BGP Nexthop Tracking, this field shows if nexthop is invalidated by IGP. + IsNexthopInvalid bool } func NewPath(source *PeerInfo, nlri bgp.AddrPrefixInterface, isWithdraw bool, pattrs []bgp.PathAttributeInterface, timestamp time.Time, noImplicitWithdraw bool) *Path { @@ -276,9 +278,10 @@ func (path *Path) IsIBGP() bool { // create new PathAttributes func (path *Path) Clone(isWithdraw bool) *Path { return &Path{ - parent: path, - IsWithdraw: isWithdraw, - filtered: make(map[string]PolicyDirection), + parent: path, + IsWithdraw: isWithdraw, + filtered: make(map[string]PolicyDirection), + IsNexthopInvalid: path.IsNexthopInvalid, } } @@ -1012,6 +1015,7 @@ func (p *Path) ToGlobal(vrf *Vrf) *Path { path.SetExtCommunities(vrf.ExportRt, false) path.delPathAttr(bgp.BGP_ATTR_TYPE_NEXT_HOP) path.setPathAttr(bgp.NewPathAttributeMpReachNLRI(nh.String(), []bgp.AddrPrefixInterface{nlri})) + path.IsNexthopInvalid = p.IsNexthopInvalid return path } @@ -1039,5 +1043,6 @@ func (p *Path) ToLocal() *Path { path.delPathAttr(bgp.BGP_ATTR_TYPE_MP_REACH_NLRI) path.setPathAttr(bgp.NewPathAttributeNextHop(nh.String())) } + path.IsNexthopInvalid = p.IsNexthopInvalid return path } |