summaryrefslogtreecommitdiffhomepage
path: root/table
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-04-28 12:02:52 +0000
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-05-01 10:16:01 +0000
commitcea5941db2dd9268ad35b5f494480350d747d404 (patch)
tree6d23e993d559a1571cd28cf74f7613706be2f4ad /table
parent0f33a508896704f9b2d21efbafa63d8f5c3e200e (diff)
table: use embededded PathDefault.Clone() method
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table')
-rw-r--r--table/path.go25
1 files changed, 1 insertions, 24 deletions
diff --git a/table/path.go b/table/path.go
index a1f87391..88765d44 100644
--- a/table/path.go
+++ b/table/path.go
@@ -198,7 +198,7 @@ func (pd *PathDefault) MarshalJSON() ([]byte, error) {
// create new PathAttributes
func (pd *PathDefault) Clone(isWithdraw bool) Path {
nlri := pd.nlri
- if isWithdraw {
+ if pd.GetRouteFamily() == bgp.RF_IPv4_UC && isWithdraw {
if pd.IsWithdraw() {
nlri = pd.nlri
} else {
@@ -420,12 +420,6 @@ func NewIPv6Path(source *PeerInfo, nlri bgp.AddrPrefixInterface, isWithdraw bool
return ipv6Path
}
-func (ipv6p *IPv6Path) Clone(isWithdraw bool) Path {
- nlri := ipv6p.nlri
- path, _ := CreatePath(ipv6p.source, nlri, ipv6p.pathAttrs, isWithdraw, ipv6p.PathDefault.timestamp)
- return path
-}
-
func (ipv6p *IPv6Path) setPathDefault(pd *PathDefault) {
ipv6p.PathDefault = pd
}
@@ -454,12 +448,6 @@ func NewIPv4VPNPath(source *PeerInfo, nlri bgp.AddrPrefixInterface, isWithdraw b
return ipv4VPNPath
}
-func (ipv4vpnp *IPv4VPNPath) Clone(isWithdraw bool) Path {
- nlri := ipv4vpnp.nlri
- path, _ := CreatePath(ipv4vpnp.source, nlri, ipv4vpnp.pathAttrs, isWithdraw, ipv4vpnp.PathDefault.timestamp)
- return path
-}
-
func (ipv4vpnp *IPv4VPNPath) setPathDefault(pd *PathDefault) {
ipv4vpnp.PathDefault = pd
}
@@ -502,12 +490,6 @@ func NewEVPNPath(source *PeerInfo, nlri bgp.AddrPrefixInterface, isWithdraw bool
return EVPNPath
}
-func (evpnp *EVPNPath) Clone(isWithdraw bool) Path {
- nlri := evpnp.nlri
- path, _ := CreatePath(evpnp.source, nlri, evpnp.pathAttrs, isWithdraw, evpnp.PathDefault.timestamp)
- return path
-}
-
func (evpnp *EVPNPath) setPathDefault(pd *PathDefault) {
evpnp.PathDefault = pd
}
@@ -556,8 +538,3 @@ func (p *EncapPath) setPathDefault(pd *PathDefault) {
func (p *EncapPath) getPathDefault() *PathDefault {
return p.PathDefault
}
-
-func (p *EncapPath) Clone(isWithdraw bool) Path {
- path, _ := CreatePath(p.source, p.nlri, p.pathAttrs, isWithdraw, p.PathDefault.timestamp)
- return path
-}