server: add missing default policy setting in (*BgpServer).Start()

policy.Reset() won't initialize global policy unless we pass a map
with key table.GLOBAL_RIB_NAME

Signed-off-by: ISHIDA Wataru <[email protected]>
This commit is contained in:
ISHIDA Wataru
2016-08-08 00:47:05 +00:00
parent 952fbbd5dd
commit 7bf91ea437
+1 -2
View File
@@ -1173,8 +1173,7 @@ func (s *BgpServer) Start(c *config.Global) (err error) {
rfs, _ := config.AfiSafis(c.AfiSafis).ToRfList()
s.globalRib = table.NewTableManager(rfs, c.MplsLabelRange.MinLabel, c.MplsLabelRange.MaxLabel)
if err = s.policy.Reset(&config.RoutingPolicy{}, map[string]config.ApplyPolicy{}); err != nil {
if err = s.policy.Reset(&config.RoutingPolicy{}, map[string]config.ApplyPolicy{table.GLOBAL_RIB_NAME: c.ApplyPolicy}); err != nil {
return
}
s.bgpConfig.Global = *c