Skip to content

Commit 05021a6

Browse files
committed
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 <[email protected]>
1 parent 0423ac0 commit 05021a6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

server/server.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,6 +1520,12 @@ func (server *BgpServer) fixupApiPath(vrfId string, pathList []*table.Path) erro
15201520
}
15211521

15221522
for _, path := range pathList {
1523+
if !path.IsWithdraw {
1524+
if _, err := path.GetOrigin(); err != nil {
1525+
return err
1526+
}
1527+
}
1528+
15231529
if path.GetSource() == nil {
15241530
path.SetSource(pi)
15251531
}

0 commit comments

Comments
 (0)