diff options
Diffstat (limited to 'table/table_manager.go')
-rw-r--r-- | table/table_manager.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/table/table_manager.go b/table/table_manager.go index be068e40..e7815af6 100644 --- a/table/table_manager.go +++ b/table/table_manager.go @@ -128,11 +128,18 @@ type TableManager struct { owner string } -func NewTableManager(owner string) *TableManager { +func NewTableManager(owner string, rfList []bgp.RouteFamily) *TableManager { t := &TableManager{} t.Tables = make(map[bgp.RouteFamily]Table) - t.Tables[bgp.RF_IPv4_UC] = NewIPv4Table(0) - t.Tables[bgp.RF_IPv6_UC] = NewIPv6Table(0) + for _, rf := range rfList { + // FIXME: NewIPTable() should handle all cases. + switch rf { + case bgp.RF_IPv4_UC: + t.Tables[bgp.RF_IPv4_UC] = NewIPv4Table(0) + case bgp.RF_IPv6_UC: + t.Tables[bgp.RF_IPv6_UC] = NewIPv6Table(0) + } + } t.owner = owner return t } |