summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2017-01-16 18:09:40 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2017-01-16 19:23:11 +0000
commitdf44cc846f88848974e77ae7efdf2e31ca6b8183 (patch)
tree5b73054f448baaa48c1a7ceae77e06fc069f4349 /vnet
parent257d5e25bf3b22b31d8388298717220f2a88224d (diff)
DHCPv6 Proxy; fix crash when DHCPv6 prxy is not configured and client packet is received
Change-Id: I0250acdee803545b8923549e2099863a95544691 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/dhcpv6/proxy_node.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vnet/vnet/dhcpv6/proxy_node.c b/vnet/vnet/dhcpv6/proxy_node.c
index 40df35cd059..4dd2239ffaa 100644
--- a/vnet/vnet/dhcpv6/proxy_node.c
+++ b/vnet/vnet/dhcpv6/proxy_node.c
@@ -244,7 +244,11 @@ dhcpv6_proxy_to_server_input (vlib_main_t * vm,
/* Send to DHCPV6 server via the configured FIB */
rx_sw_if_index = sw_if_index = vnet_buffer(b0)->sw_if_index[VLIB_RX];
rx_fib_idx = im->fib_index_by_sw_if_index [rx_sw_if_index];
- server_idx = dpm->dhcp6_server_index_by_rx_fib_index[rx_fib_idx];
+
+ if (vec_len(dpm->dhcp6_server_index_by_rx_fib_index) <= rx_fib_idx)
+ goto no_server;
+
+ server_idx = dpm->dhcp6_server_index_by_rx_fib_index[rx_fib_idx];
if (PREDICT_FALSE (pool_is_free_index (dpm->dhcp6_servers,
server_idx)))