Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Ping; remove unused arrays
[vpp.git]
/
src
/
vnet
/
ip
/
ping.c
diff --git
a/src/vnet/ip/ping.c
b/src/vnet/ip/ping.c
index
096b2eb
..
2c5c44f
100755
(executable)
--- a/
src/vnet/ip/ping.c
+++ b/
src/vnet/ip/ping.c
@@
-46,6
+46,21
@@
format_icmp_echo_trace (u8 * s, va_list * va)
return s;
}
return s;
}
+static u8 *
+format_ip46_ping_result (u8 * s, va_list * args)
+{
+ send_ip46_ping_result_t res = va_arg (*args, send_ip46_ping_result_t);
+
+ switch (res)
+ {
+#define _(v, n) case SEND_PING_##v: s = format(s, "%s", n);
+ foreach_ip46_ping_result
+#undef _
+ }
+
+ return (s);
+}
+
/*
* If we can find the ping run by an ICMP ID, then we send the signal
* to the CLI process referenced by that ping run, alongside with
/*
* If we can find the ping run by an ICMP ID, then we send the signal
* to the CLI process referenced by that ping run, alongside with
@@
-219,9
+234,6
@@
VLIB_REGISTER_NODE (ip4_icmp_echo_reply_node, static) =
};
/* *INDENT-ON* */
};
/* *INDENT-ON* */
-char *ip6_lookup_next_nodes[] = IP6_LOOKUP_NEXT_NODES;
-char *ip4_lookup_next_nodes[] = IP4_LOOKUP_NEXT_NODES;
-
/* 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,
/* 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,
@@
-582,25
+594,30
@@
run_ping_ip46_address (vlib_main_t * vm, u32 table_id, ip4_address_t * pa4,
hash_set (pm->ping_run_by_icmp_id, icmp_id, ping_run_index);
for (i = 1; i <= ping_repeat; i++)
{
hash_set (pm->ping_run_by_icmp_id, icmp_id, ping_run_index);
for (i = 1; i <= ping_repeat; i++)
{
+ send_ip46_ping_result_t res = SEND_PING_OK;
f64 sleep_interval;
f64 time_ping_sent = vlib_time_now (vm);
/* Reset pr: running ping in other process could have changed pm->ping_runs */
pr = vec_elt_at_index (pm->ping_runs, ping_run_index);
pr->curr_seq = i;
f64 sleep_interval;
f64 time_ping_sent = vlib_time_now (vm);
/* Reset pr: running ping in other process could have changed pm->ping_runs */
pr = vec_elt_at_index (pm->ping_runs, ping_run_index);
pr->curr_seq = i;
- if (pa6 &&
- (SEND_PING_OK ==
- send_ip6_ping (vm, ping_main.ip6_main, table_id, pa6, sw_if_index,
- i, icmp_id, data_len, ping_burst, verbose)))
+ if (pa6)
{
{
- n_requests += ping_burst;
+ res = send_ip6_ping (vm, ping_main.ip6_main, table_id,
+ pa6, sw_if_index, i, icmp_id,
+ data_len, ping_burst, verbose);
}
}
- if (pa4 &&
- (SEND_PING_OK ==
- send_ip4_ping (vm, ping_main.ip4_main, table_id, pa4, sw_if_index,
- i, icmp_id, data_len, ping_burst, verbose)))
+ if (pa4)
+ {
+ res = send_ip4_ping (vm, ping_main.ip4_main, table_id, pa4,
+ sw_if_index, i, icmp_id, data_len,
+ ping_burst, verbose);
+ }
+ if (SEND_PING_OK == res)
{
n_requests += ping_burst;
}
{
n_requests += ping_burst;
}
+ else
+ vlib_cli_output (vm, "Failed: %U", format_ip46_ping_result, res);
while ((i <= ping_repeat)
&&
((sleep_interval =
while ((i <= ping_repeat)
&&
((sleep_interval =