Skip to content

Commit

Permalink
server: reject route without origin attribute via AddPath()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
fujita committed May 31, 2018
1 parent 0423ac0 commit 05021a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/server.go
Expand Up @@ -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)
}
Expand Down

0 comments on commit 05021a6

Please sign in to comment.