diff options
-rw-r--r-- | vnet/vnet/devices/af_packet/af_packet.c | 3 | ||||
-rw-r--r-- | vnet/vnet/devices/dpdk/cli.c | 2 | ||||
-rw-r--r-- | vnet/vnet/ethernet/node.c | 1 | ||||
-rw-r--r-- | vnet/vnet/interface_cli.c | 10 | ||||
-rw-r--r-- | vnet/vnet/ip/ip4_forward.c | 7 |
5 files changed, 14 insertions, 9 deletions
diff --git a/vnet/vnet/devices/af_packet/af_packet.c b/vnet/vnet/devices/af_packet/af_packet.c index e3ed3857..91f3c22d 100644 --- a/vnet/vnet/devices/af_packet/af_packet.c +++ b/vnet/vnet/devices/af_packet/af_packet.c @@ -156,7 +156,8 @@ create_packet_v2_sock(u8 * name, tpacket_req_t * rx_req, tpacket_req_t * tx_req, return 0; error: - close(*fd); + if (*fd >= 0) + close(*fd); *fd = -1; return ret; } diff --git a/vnet/vnet/devices/dpdk/cli.c b/vnet/vnet/devices/dpdk/cli.c index 3b0befd5..c449eebd 100644 --- a/vnet/vnet/devices/dpdk/cli.c +++ b/vnet/vnet/devices/dpdk/cli.c @@ -642,7 +642,7 @@ set_dpdk_if_desc (vlib_main_t *vm, unformat_input_t *input, rv = dpdk_port_setup(dm, xd); - return rv < 0 ? rv : 0; + return rv; } VLIB_CLI_COMMAND (cmd_set_dpdk_if_desc,static) = { diff --git a/vnet/vnet/ethernet/node.c b/vnet/vnet/ethernet/node.c index 57a69959..eae0a2b4 100644 --- a/vnet/vnet/ethernet/node.c +++ b/vnet/vnet/ethernet/node.c @@ -76,7 +76,6 @@ vlib_node_registration_t ethernet_input_node; typedef enum { ETHERNET_INPUT_VARIANT_ETHERNET, ETHERNET_INPUT_VARIANT_ETHERNET_TYPE, - ETHERNET_INPUT_VARIANT_VLAN, ETHERNET_INPUT_VARIANT_NOT_L2, } ethernet_input_variant_t; diff --git a/vnet/vnet/interface_cli.c b/vnet/vnet/interface_cli.c index d0d75154..9052f623 100644 --- a/vnet/vnet/interface_cli.c +++ b/vnet/vnet/interface_cli.c @@ -605,15 +605,15 @@ create_sub_interfaces (vlib_main_t * vm, template.sup_sw_if_index = hi->sw_if_index; template.sub.id = id; error = vnet_create_sw_interface (vnm, &template, &sw_if_index); - if (error) goto done; + if (error) + goto done; + hash_set (hi->sub_interface_sw_if_index_by_id, id, sw_if_index); hash_set_mem (im->sw_if_index_by_sup_and_sub, kp, sw_if_index); - vlib_cli_output(vm, "%U\n", format_vnet_sw_if_index_name, vnet_get_main(), sw_if_index); + vlib_cli_output(vm, "%U\n", format_vnet_sw_if_index_name, + vnet_get_main(), sw_if_index); } - if (error) - goto done; - done: return error; } diff --git a/vnet/vnet/ip/ip4_forward.c b/vnet/vnet/ip/ip4_forward.c index 6b7fa9b4..767cc8f8 100644 --- a/vnet/vnet/ip/ip4_forward.c +++ b/vnet/vnet/ip/ip4_forward.c @@ -193,7 +193,12 @@ ip4_fib_set_adj_index (ip4_main_t * im, fib->new_hash_values); p = hash_get (hash, dst_address_u32); - clib_memcpy (p, fib->new_hash_values, vec_bytes (fib->new_hash_values)); + /* hash_get should never return NULL here */ + if (p) + clib_memcpy (p, fib->new_hash_values, + vec_bytes (fib->new_hash_values)); + else + ASSERT(0); } } |