aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-02-14 01:44:25 -0800
committerDamjan Marion <dmarion.lists@gmail.com>2017-02-17 16:35:04 +0000
commit6cfc39c3e9522470e82f4cd43e6cd992a0d67ed1 (patch)
treee64bf8380758476cd13f3f3fbb3e9c0d07fad5d3 /src/vnet
parentc48829bb0a29e7b53a5e0b6bcecd13a328b19dcf (diff)
Remove duplicate ip6 get interface address code
Change-Id: I5e0057b36bc4221e688a27fc1c0f602f78132991 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/dhcpv6/proxy_node.c22
-rw-r--r--src/vnet/ip/ip6.h5
-rw-r--r--src/vnet/ip/ip6_forward.c8
-rw-r--r--src/vnet/ip/ping.c21
4 files changed, 9 insertions, 47 deletions
diff --git a/src/vnet/dhcpv6/proxy_node.c b/src/vnet/dhcpv6/proxy_node.c
index 77afef2aa7d..4137624c5b4 100644
--- a/src/vnet/dhcpv6/proxy_node.c
+++ b/src/vnet/dhcpv6/proxy_node.c
@@ -110,24 +110,6 @@ ip6_interface_first_global_or_site_address (ip6_main_t * im, u32 sw_if_index)
return result;
}
-/* get first interface address */
-static ip6_address_t *
-ip6_interface_first_address (ip6_main_t * im, u32 sw_if_index)
-{
- ip_lookup_main_t * lm = &im->lookup_main;
- ip_interface_address_t * ia = 0;
- ip6_address_t * result = 0;
-
- foreach_ip_interface_address (lm, ia, sw_if_index,
- 1 /* honor unnumbered */,
- ({
- ip6_address_t * a = ip_interface_address_get_address (lm, ia);
- result = a;
- break;
- }));
- return result;
-}
-
static inline void copy_ip6_address (ip6_address_t *dst, ip6_address_t *src)
{
@@ -813,8 +795,8 @@ int dhcpv6_proxy_set_server (ip6_address_t *addr, ip6_address_t *src_address,
}
int dhcpv6_proxy_set_server_2 (ip6_address_t *addr, ip6_address_t *src_address,
- u32 rx_fib_id, u32 server_fib_id,
- int insert_vss, int is_del)
+ u32 rx_fib_id, u32 server_fib_id,
+ int insert_vss, int is_del)
{
dhcpv6_proxy_main_t * dm = &dhcpv6_proxy_main;
dhcpv6_server_t * server = 0;
diff --git a/src/vnet/ip/ip6.h b/src/vnet/ip/ip6.h
index 1844d727cc0..5456f0f2ed6 100644
--- a/src/vnet/ip/ip6.h
+++ b/src/vnet/ip/ip6.h
@@ -332,6 +332,11 @@ clib_error_t *ip6_add_del_interface_address (vlib_main_t * vm,
u32 address_length, u32 is_del);
void ip6_sw_interface_enable_disable (u32 sw_if_index, u32 is_enable);
+/**
+ * @brie get first IPv6 interface address
+ */
+ip6_address_t *ip6_interface_first_address (ip6_main_t * im, u32 sw_if_index);
+
int ip6_address_compare (ip6_address_t * a1, ip6_address_t * a2);
clib_error_t *ip6_probe_neighbor (vlib_main_t * vm, ip6_address_t * dst,
diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c
index c15683e2390..5dd22b99ca2 100644
--- a/src/vnet/ip/ip6_forward.c
+++ b/src/vnet/ip/ip6_forward.c
@@ -428,9 +428,7 @@ ip6_sw_interface_enable_disable (u32 sw_if_index, u32 is_enable)
/* get first interface address */
ip6_address_t *
-ip6_interface_first_address (ip6_main_t * im,
- u32 sw_if_index,
- ip_interface_address_t ** result_ia)
+ip6_interface_first_address (ip6_main_t * im, u32 sw_if_index)
{
ip_lookup_main_t *lm = &im->lookup_main;
ip_interface_address_t *ia = 0;
@@ -445,8 +443,6 @@ ip6_interface_first_address (ip6_main_t * im,
break;
}));
/* *INDENT-ON* */
- if (result_ia)
- *result_ia = result ? ia : 0;
return result;
}
@@ -3318,7 +3314,7 @@ vnet_set_ip6_classify_intfc (vlib_main_t * vm, u32 sw_if_index,
vec_validate (lm->classify_table_index_by_sw_if_index, sw_if_index);
lm->classify_table_index_by_sw_if_index[sw_if_index] = table_index;
- if_addr = ip6_interface_first_address (ipm, sw_if_index, NULL);
+ if_addr = ip6_interface_first_address (ipm, sw_if_index);
if (NULL != if_addr)
{
diff --git a/src/vnet/ip/ping.c b/src/vnet/ip/ping.c
index 00e2bfb18e2..e4f2ee72f82 100644
--- a/src/vnet/ip/ping.c
+++ b/src/vnet/ip/ping.c
@@ -214,27 +214,6 @@ VLIB_REGISTER_NODE (ip4_icmp_echo_reply_node, static) =
char *ip6_lookup_next_nodes[] = IP6_LOOKUP_NEXT_NODES;
char *ip4_lookup_next_nodes[] = IP4_LOOKUP_NEXT_NODES;
-/* get first interface address */
-static ip6_address_t *
-ip6_interface_first_address (ip6_main_t * im, u32 sw_if_index)
-{
- ip_lookup_main_t *lm = &im->lookup_main;
- ip_interface_address_t *ia = 0;
- ip6_address_t *result = 0;
-
- /* *INDENT-OFF* */
- foreach_ip_interface_address (lm, ia, sw_if_index,
- 1 /* honor unnumbered */ ,
- ({
- ip6_address_t * a =
- ip_interface_address_get_address (lm, ia);
- result = a;
- break;
- }));
- /* *INDENT-ON* */
- return result;
-}
-
/* Fill in the ICMP ECHO structure, return the safety-checked and possibly shrunk data_len */
static u16
init_icmp46_echo_request (icmp46_echo_request_t * icmp46_echo,