summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorIgor Mikhailov (imichail) <imichail@cisco.com>2016-11-09 12:38:33 -0800
committerIgor Mikhailov (imichail) <imichail@cisco.com>2016-11-09 12:38:33 -0800
commit2138b351dbd53dd8fb05541d215458931c188ede (patch)
tree0334bd48b86ef529a9b2ab680ece755b27c47188 /vnet
parent8d2e0e02433b0097898c332aa0aeedb34c223a6f (diff)
Fix DHCP proxy when used for non-default FIB tables
An issue is that the server->server_fib_index is overwritten by some incorrect value on subsequent calls to the function - e.g. when setting DHCP proxy for the same FIB table several times. Change-Id: I2e129b47f5c8fe3a0b924a7d71bb83e6fc53e9b5 Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/dhcp/proxy_node.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/vnet/vnet/dhcp/proxy_node.c b/vnet/vnet/dhcp/proxy_node.c
index 7018fc3958b..d0d99d7e03b 100644
--- a/vnet/vnet/dhcp/proxy_node.c
+++ b/vnet/vnet/dhcp/proxy_node.c
@@ -712,8 +712,6 @@ int dhcp_proxy_set_server_2 (ip4_address_t *addr, ip4_address_t *src_address,
rx_fib_index = fib_table_find_or_create_and_lock(FIB_PROTOCOL_IP4,
rx_fib_id);
- server_index = fib_table_find_or_create_and_lock(FIB_PROTOCOL_IP4,
- server_fib_id);
if (rx_fib_id == 0)
{
@@ -758,7 +756,9 @@ int dhcp_proxy_set_server_2 (ip4_address_t *addr, ip4_address_t *src_address,
initialize_it:
server->dhcp_server.as_u32 = addr->as_u32;
- server->server_fib_index = server_index;
+ server->server_fib_index =
+ fib_table_find_or_create_and_lock(FIB_PROTOCOL_IP4,
+ server_fib_id);
server->dhcp_src_address.as_u32 = src_address->as_u32;
server->insert_option_82 = insert_option_82;
server->valid = 1;