diff options
author | Keith Wiles <keith.wiles@intel.com> | 2016-02-11 19:21:10 -0600 |
---|---|---|
committer | Keith Wiles <keith.wiles@intel.com> | 2016-02-12 13:23:28 -0600 |
commit | cb46684aacb226285807d145a18e1acf8ed21ca0 (patch) | |
tree | 17131667ac8768187a7ed8d0a92e994b2e34400b | |
parent | 52642c3c535128cb96489fed45327bdd55953397 (diff) |
Fix ARP show exception when not ARP entries as found.
The fix tests if the ARP table exist before attempting to
interate over the entries.
Change-Id: I22cad5ba3a01c3fba1feac33745a29ff1f7f8fe1
Signed-off-by: Keith Wiles <keith.wiles@intel.com>
-rw-r--r-- | vnet/vnet/ethernet/arp.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/vnet/vnet/ethernet/arp.c b/vnet/vnet/ethernet/arp.c index 79ff44fd050..3548831688a 100644 --- a/vnet/vnet/ethernet/arp.c +++ b/vnet/vnet/ethernet/arp.c @@ -1138,14 +1138,17 @@ show_ip4_arp (vlib_main_t * vm, es = 0; pool_foreach (e, am->ip4_entry_pool, ({ vec_add1 (es, e[0]); })); - vec_sort_with_function (es, ip4_arp_entry_sort); - vlib_cli_output (vm, "%U", format_ethernet_arp_ip4_entry, vnm, 0); - vec_foreach (e, es) { - if (sw_if_index != ~0 && e->key.sw_if_index != sw_if_index) - continue; - vlib_cli_output (vm, "%U", format_ethernet_arp_ip4_entry, vnm, e); - } - vec_free (es); + if ( es ) + { + vec_sort_with_function (es, ip4_arp_entry_sort); + vlib_cli_output (vm, "%U", format_ethernet_arp_ip4_entry, vnm, 0); + vec_foreach (e, es) { + if (sw_if_index != ~0 && e->key.sw_if_index != sw_if_index) + continue; + vlib_cli_output (vm, "%U", format_ethernet_arp_ip4_entry, vnm, e); + } + vec_free (es); + } if (vec_len (am->proxy_arps)) { |