summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-05-31 21:31:20 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-05-31 21:31:20 +0900
commit05021a6e5f924e34e8908ec294527b07f02a88b2 (patch)
tree362843dd9217f4fc08c68f072ec1d58e531c5245
parent0423ac05e9939ad8ecfefabd6b6de7d4dd4aaf8e (diff)
server: reject route without origin attribute via AddPath()
We should do stricter validation. Probably, we should use packet/bgp/validate.go. close #1660 Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--server/server.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/server/server.go b/server/server.go
index 5a1dd8fc..a15c342b 100644
--- a/server/server.go
+++ b/server/server.go
@@ -1520,6 +1520,12 @@ func (server *BgpServer) fixupApiPath(vrfId string, pathList []*table.Path) erro
}
for _, path := range pathList {
+ if !path.IsWithdraw {
+ if _, err := path.GetOrigin(); err != nil {
+ return err
+ }
+ }
+
if path.GetSource() == nil {
path.SetSource(pi)
}