summaryrefslogtreecommitdiffhomepage
path: root/server/server.go
diff options
context:
space:
mode:
authorWataru Ishida <ishida.wataru@lab.ntt.co.jp>2017-01-22 00:37:58 -0500
committerWataru Ishida <ishida.wataru@lab.ntt.co.jp>2017-01-22 00:37:58 -0500
commitbb42a6832f14edb65c06256bfb4d7029faf9f3bb (patch)
tree99f275faff348a056d6af1e71c1a442d7cf8b279 /server/server.go
parent99ed1e73d7fe2245c36e4adb5f5cd924c4d55516 (diff)
api: add a UUID field to Path structure
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server/server.go')
-rw-r--r--server/server.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/server/server.go b/server/server.go
index c73aabc4..4ac89039 100644
--- a/server/server.go
+++ b/server/server.go
@@ -28,7 +28,6 @@ import (
"github.com/osrg/gobgp/config"
"github.com/osrg/gobgp/packet/bgp"
"github.com/osrg/gobgp/table"
- "github.com/satori/go.uuid"
)
type TCPListener struct {
@@ -1138,8 +1137,7 @@ func (s *BgpServer) AddPath(vrfId string, pathList []*table.Path) (uuidBytes []b
return err
}
if len(pathList) == 1 {
- uuidBytes = uuid.NewV4().Bytes()
- pathList[0].SetUUID(uuidBytes)
+ pathList[0].AssignNewUUID()
}
s.propagateUpdate(nil, pathList)
return nil
@@ -1153,7 +1151,7 @@ func (s *BgpServer) DeletePath(uuid []byte, f bgp.RouteFamily, vrfId string, pat
if len(uuid) > 0 {
path := func() *table.Path {
for _, path := range s.globalRib.GetPathList(table.GLOBAL_RIB_NAME, s.globalRib.GetRFlist()) {
- if len(path.UUID()) > 0 && bytes.Equal(path.UUID(), uuid) {
+ if len(path.UUID()) > 0 && bytes.Equal(path.UUID().Bytes(), uuid) {
return path
}
}