summaryrefslogtreecommitdiffstats
path: root/src/vnet/dhcp/dhcp_proxy.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-09-10 04:39:11 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2017-09-11 10:14:36 +0000
commit1500254bee11355bbd69cc1dd9705be4f002f2bd (patch)
treec403642105f399baccb3a727020232b5732fe8f7 /src/vnet/dhcp/dhcp_proxy.c
parenta7191840beeb2c3a0f2598707ed1051a9f23c45f (diff)
FIB table add/delete API
part 2; - this adds the code to create an IP and MPLS table via the API. - but the enforcement that the table must be created before it is used is still missing, this is so that CSIT can pass. Change-Id: Id124d884ade6cb7da947225200e3bb193454c555 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/dhcp/dhcp_proxy.c')
-rw-r--r--src/vnet/dhcp/dhcp_proxy.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/vnet/dhcp/dhcp_proxy.c b/src/vnet/dhcp/dhcp_proxy.c
index ba7f354e9fa..1784906b7b3 100644
--- a/src/vnet/dhcp/dhcp_proxy.c
+++ b/src/vnet/dhcp/dhcp_proxy.c
@@ -29,9 +29,9 @@ dhcp_proxy_rx_table_lock (fib_protocol_t proto,
u32 fib_index)
{
if (FIB_PROTOCOL_IP4 == proto)
- fib_table_lock(fib_index, proto);
+ fib_table_lock(fib_index, proto, FIB_SOURCE_DHCP);
else
- mfib_table_lock(fib_index, proto);
+ mfib_table_lock(fib_index, proto, MFIB_SOURCE_DHCP);
}
static void
@@ -39,9 +39,9 @@ dhcp_proxy_rx_table_unlock (fib_protocol_t proto,
u32 fib_index)
{
if (FIB_PROTOCOL_IP4 == proto)
- fib_table_unlock(fib_index, proto);
+ fib_table_unlock(fib_index, proto, FIB_SOURCE_DHCP);
else
- mfib_table_unlock(fib_index, proto);
+ mfib_table_unlock(fib_index, proto, MFIB_SOURCE_DHCP);
}
u32
@@ -169,7 +169,7 @@ dhcp_proxy_server_del (fib_protocol_t proto,
if (~0 != index)
{
server = &proxy->dhcp_servers[index];
- fib_table_unlock (server->server_fib_index, proto);
+ fib_table_unlock (server->server_fib_index, proto, FIB_SOURCE_DHCP);
vec_del1(proxy->dhcp_servers, index);
@@ -228,7 +228,8 @@ dhcp_proxy_server_add (fib_protocol_t proto,
dhcp_server_t server = {
.dhcp_server = *addr,
.server_fib_index = fib_table_find_or_create_and_lock(proto,
- server_table_id),
+ server_table_id,
+ FIB_SOURCE_DHCP),
};
vec_add1(proxy->dhcp_servers, server);
@@ -297,9 +298,11 @@ int dhcp_proxy_set_vss (fib_protocol_t proto,
int rc = 0;
if (proto == FIB_PROTOCOL_IP4)
- rx_fib_index = fib_table_find_or_create_and_lock(proto, tbl_id);
+ rx_fib_index = fib_table_find_or_create_and_lock(proto, tbl_id,
+ FIB_SOURCE_DHCP);
else
- rx_fib_index = mfib_table_find_or_create_and_lock(proto, tbl_id);
+ rx_fib_index = mfib_table_find_or_create_and_lock(proto, tbl_id,
+ MFIB_SOURCE_DHCP);
v = dhcp_get_vss_info(dm, rx_fib_index, proto);
if (NULL != v)