diff options
Diffstat (limited to 'table/path.go')
-rw-r--r-- | table/path.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/table/path.go b/table/path.go index 05a54aaa..c095ab24 100644 --- a/table/path.go +++ b/table/path.go @@ -54,6 +54,7 @@ type Path interface { Clone(IsWithdraw bool) Path getTimestamp() time.Time setTimestamp(t time.Time) + isLocal() bool ToApiStruct() *api.Path MarshalJSON() ([]byte, error) } @@ -180,6 +181,14 @@ func (pd *PathDefault) setTimestamp(t time.Time) { pd.timestamp = t } +func (pd *PathDefault) isLocal() bool { + var ret bool + if pd.source.Address == nil { + ret = true + } + return ret +} + func (pd *PathDefault) ToApiStruct() *api.Path { pathAttrs := func(arg []bgp.PathAttributeInterface) []*api.PathAttr { ret := make([]*api.PathAttr, 0, len(arg)) |