diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-04-03 15:06:50 +0200 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2018-04-30 11:56:23 +0200 |
commit | 31c28cd7083149a7888e4882d3cda4a0b62a0d4d (patch) | |
tree | 4fdb295d925f123c8d1c3654bfacdb3dc8fa0bc0 /bgpd/bgp_pbr.c | |
parent | bgpd: handle FS redirect IP rule in PBR (diff) | |
download | frr-31c28cd7083149a7888e4882d3cda4a0b62a0d4d.tar.xz frr-31c28cd7083149a7888e4882d3cda4a0b62a0d4d.zip |
bgpd: get table identifier from table manager
A table chunk of 100000 is allocated from zebra, and when needed in
flowspec, the table identifier is extracted from that chunk.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd/bgp_pbr.c')
-rw-r--r-- | bgpd/bgp_pbr.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/bgpd/bgp_pbr.c b/bgpd/bgp_pbr.c index d7a4c920f..4813bc0ce 100644 --- a/bgpd/bgp_pbr.c +++ b/bgpd/bgp_pbr.c @@ -805,16 +805,13 @@ static void bgp_pbr_policyroute_add_to_zebra(struct bgp *bgp, bgp_pbr_action_alloc_intern); if (bpa->fwmark == 0) { - /* TODO: allocate new table ID using zebra */ - static int fwmark_id; - /* drop is handled by iptable */ if (nh && nh->type == NEXTHOP_TYPE_BLACKHOLE) { bpa->table_id = 0; bpa->installed = true; } else { - bpa->fwmark = ++fwmark_id; - bpa->table_id = fwmark_id; + bpa->fwmark = bgp_zebra_tm_get_id(); + bpa->table_id = bpa->fwmark; bpa->installed = false; } bpa->unique = ++bgp_pbr_action_counter_unique; |