diff options
author | Dave Barach <dave@barachs.net> | 2018-10-17 10:38:51 -0400 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-10-23 13:06:46 +0000 |
commit | b7b929931a07fbb27b43d5cd105f366c3e29807e (patch) | |
tree | 438681c89738802dbb5d339715b96ea2c31bafb4 /src/vnet/dhcp | |
parent | b9a4c445c1d4e9cdab476a8e1fb8a46ff0fc6080 (diff) |
c11 safe string handling support
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/dhcp')
-rw-r--r-- | src/vnet/dhcp/client.c | 8 | ||||
-rw-r--r-- | src/vnet/dhcp/dhcp4_proxy_node.c | 6 | ||||
-rw-r--r-- | src/vnet/dhcp/dhcp6_client_common_dp.c | 2 | ||||
-rw-r--r-- | src/vnet/dhcp/dhcp6_ia_na_client_dp.c | 2 | ||||
-rw-r--r-- | src/vnet/dhcp/dhcp6_pd_client_cp.c | 2 | ||||
-rw-r--r-- | src/vnet/dhcp/dhcp6_pd_client_dp.c | 2 | ||||
-rw-r--r-- | src/vnet/dhcp/dhcp6_proxy_node.c | 6 | ||||
-rw-r--r-- | src/vnet/dhcp/dhcp_api.c | 4 | ||||
-rw-r--r-- | src/vnet/dhcp/dhcp_proxy.c | 2 |
9 files changed, 17 insertions, 17 deletions
diff --git a/src/vnet/dhcp/client.c b/src/vnet/dhcp/client.c index 98f212334f6..32333054fa3 100644 --- a/src/vnet/dhcp/client.c +++ b/src/vnet/dhcp/client.c @@ -422,7 +422,7 @@ send_dhcp_pkt (dhcp_client_main_t * dcm, dhcp_client_t * c, dhcp = (dhcp_header_t *) (udp + 1); /* $$$ optimize, maybe */ - memset (ip, 0, sizeof (*ip) + sizeof (*udp) + sizeof (*dhcp)); + clib_memset (ip, 0, sizeof (*ip) + sizeof (*udp) + sizeof (*dhcp)); ip->ip_version_and_header_length = 0x45; ip->ttl = 128; @@ -908,7 +908,7 @@ dhcp_client_add_del (dhcp_client_add_del_args_t * a) if (a->is_add) { pool_get (dcm->clients, c); - memset (c, 0, sizeof (*c)); + clib_memset (c, 0, sizeof (*c)); c->state = DHCP_DISCOVER; c->sw_if_index = a->sw_if_index; c->client_index = a->client_index; @@ -984,7 +984,7 @@ dhcp_client_config (u32 is_add, dhcp_client_add_del_args_t _a, *a = &_a; int rv; - memset (a, 0, sizeof (*a)); + clib_memset (a, 0, sizeof (*a)); a->is_add = is_add; a->sw_if_index = sw_if_index; a->client_index = client_index; @@ -1106,7 +1106,7 @@ dhcp_client_set_command_fn (vlib_main_t * vm, if (sw_if_index_set == 0) return clib_error_return (0, "interface not specified"); - memset (a, 0, sizeof (*a)); + clib_memset (a, 0, sizeof (*a)); a->is_add = is_add; a->sw_if_index = sw_if_index; a->hostname = hostname; diff --git a/src/vnet/dhcp/dhcp4_proxy_node.c b/src/vnet/dhcp/dhcp4_proxy_node.c index 6b15c51b38f..97ed3b5920a 100644 --- a/src/vnet/dhcp/dhcp4_proxy_node.c +++ b/src/vnet/dhcp/dhcp4_proxy_node.c @@ -685,7 +685,7 @@ dhcp_proxy_to_client_input (vlib_main_t * vm, hi0 = vnet_get_sup_hw_interface (vnm, original_sw_if_index); ei0 = pool_elt_at_index (em->interfaces, hi0->hw_instance); clib_memcpy (mac0->src_address, ei0->address, sizeof (ei0->address)); - memset (mac0->dst_address, 0xff, sizeof (mac0->dst_address)); + clib_memset (mac0->dst_address, 0xff, sizeof (mac0->dst_address)); mac0->type = (si0->type == VNET_SW_INTERFACE_TYPE_SUB) ? clib_net_to_host_u16 (0x8100) : clib_net_to_host_u16 (0x0800); @@ -818,8 +818,8 @@ dhcp4_proxy_set_command_fn (vlib_main_t * vm, int is_del = 0; int set_src = 0, set_server = 0; - memset (&server_addr, 0, sizeof (server_addr)); - memset (&src_addr, 0, sizeof (src_addr)); + clib_memset (&server_addr, 0, sizeof (server_addr)); + clib_memset (&src_addr, 0, sizeof (src_addr)); while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { diff --git a/src/vnet/dhcp/dhcp6_client_common_dp.c b/src/vnet/dhcp/dhcp6_client_common_dp.c index 1a3c7bcb278..a6ed42de578 100644 --- a/src/vnet/dhcp/dhcp6_client_common_dp.c +++ b/src/vnet/dhcp/dhcp6_client_common_dp.c @@ -192,7 +192,7 @@ dhcpv6_client_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, ntohs (ip0->payload_length) - dhcpv6_ip6_palyoad_offset - sizeof (*dhcpv60); - memset (&report, 0, sizeof (report)); + clib_memset (&report, 0, sizeof (report)); sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_RX]; if (sw_if_index >= vec_len (icm->client_state_by_sw_if_index)) diff --git a/src/vnet/dhcp/dhcp6_ia_na_client_dp.c b/src/vnet/dhcp/dhcp6_ia_na_client_dp.c index 60641227700..11abfccea76 100644 --- a/src/vnet/dhcp/dhcp6_ia_na_client_dp.c +++ b/src/vnet/dhcp/dhcp6_ia_na_client_dp.c @@ -516,7 +516,7 @@ dhcp6_reply_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vec_len (events[i].addresses) * sizeof (vl_api_dhcp6_address_info_t); vl_api_dhcp6_reply_event_t *event = clib_mem_alloc (event_size); - memset (event, 0, event_size); + clib_memset (event, 0, event_size); event->sw_if_index = htonl (events[i].body.sw_if_index); event->server_index = htonl (events[i].body.server_index); diff --git a/src/vnet/dhcp/dhcp6_pd_client_cp.c b/src/vnet/dhcp/dhcp6_pd_client_cp.c index 33813789e70..9663a5718ec 100644 --- a/src/vnet/dhcp/dhcp6_pd_client_cp.c +++ b/src/vnet/dhcp/dhcp6_pd_client_cp.c @@ -1257,7 +1257,7 @@ dhcp6_pd_client_enable_disable (u32 sw_if_index, const u8 * prefix_group, vec_free (prefix_list); - memset (client_state, 0, sizeof (*client_state)); + clib_memset (client_state, 0, sizeof (*client_state)); } return 0; diff --git a/src/vnet/dhcp/dhcp6_pd_client_dp.c b/src/vnet/dhcp/dhcp6_pd_client_dp.c index 009de4a4431..9fb6096b8d5 100644 --- a/src/vnet/dhcp/dhcp6_pd_client_dp.c +++ b/src/vnet/dhcp/dhcp6_pd_client_dp.c @@ -523,7 +523,7 @@ dhcp6_pd_reply_process (vlib_main_t * vm, vlib_node_runtime_t * rt, sizeof (vl_api_dhcp6_pd_prefix_info_t); vl_api_dhcp6_pd_reply_event_t *event = clib_mem_alloc (event_size); - memset (event, 0, event_size); + clib_memset (event, 0, event_size); event->sw_if_index = htonl (events[i].body.sw_if_index); event->server_index = htonl (events[i].body.server_index); diff --git a/src/vnet/dhcp/dhcp6_proxy_node.c b/src/vnet/dhcp/dhcp6_proxy_node.c index 7d157ad35a1..34454d6bd56 100644 --- a/src/vnet/dhcp/dhcp6_proxy_node.c +++ b/src/vnet/dhcp/dhcp6_proxy_node.c @@ -389,7 +389,7 @@ dhcpv6_proxy_to_server_input (vlib_main_t * vm, sizeof (*r1) + sizeof (*fwd_opt) + sizeof (*u1) + sizeof (*id1) + u1->length); - memset (ip1, 0, sizeof (*ip1)); + clib_memset (ip1, 0, sizeof (*ip1)); ip1->ip_version_traffic_class_and_flow_label = 0x60; ip1->payload_length = u1->length; ip1->protocol = PROTO_UDP; @@ -739,7 +739,7 @@ dhcpv6_proxy_to_client_input (vlib_main_t * vm, } len = clib_net_to_host_u16 (r0->length); - memset (ip1, 0, sizeof (*ip1)); + clib_memset (ip1, 0, sizeof (*ip1)); copy_ip6_address (&ip1->dst_address, &client_address); u1->checksum = 0; u1->src_port = clib_net_to_host_u16 (UDP_DST_PORT_dhcpv6_to_server); @@ -767,7 +767,7 @@ dhcpv6_proxy_to_client_input (vlib_main_t * vm, hi0 = vnet_get_sup_hw_interface (vnm, original_sw_if_index); ei0 = pool_elt_at_index (em->interfaces, hi0->hw_instance); clib_memcpy (mac0->src_address, ei0->address, sizeof (ei0->address)); - memset (&mac0->dst_address, 0xff, sizeof (mac0->dst_address)); + clib_memset (&mac0->dst_address, 0xff, sizeof (mac0->dst_address)); mac0->type = (si0->type == VNET_SW_INTERFACE_TYPE_SUB) ? clib_net_to_host_u16 (0x8100) : clib_net_to_host_u16 (0x86dd); diff --git a/src/vnet/dhcp/dhcp_api.c b/src/vnet/dhcp/dhcp_api.c index 59ab6dcbba5..cd30e1d2f94 100644 --- a/src/vnet/dhcp/dhcp_api.c +++ b/src/vnet/dhcp/dhcp_api.c @@ -148,7 +148,7 @@ dhcp_send_details (fib_protocol_t proto, mp = vl_msg_api_alloc (n); if (!mp) return; - memset (mp, 0, n); + clib_memset (mp, 0, n); mp->_vl_msg_id = ntohs (VL_API_DHCP_PROXY_DETAILS); mp->context = context; mp->count = count; @@ -324,7 +324,7 @@ send_dhcp_client_entry (const dhcp_client_t * client, void *arg) ctx = arg; mp = vl_msg_api_alloc (sizeof (*mp)); - memset (mp, 0, sizeof (*mp)); + clib_memset (mp, 0, sizeof (*mp)); mp->_vl_msg_id = ntohs (VL_API_DHCP_CLIENT_DETAILS); mp->context = ctx->context; diff --git a/src/vnet/dhcp/dhcp_proxy.c b/src/vnet/dhcp/dhcp_proxy.c index 88cdcacd62b..9a69041bc1d 100644 --- a/src/vnet/dhcp/dhcp_proxy.c +++ b/src/vnet/dhcp/dhcp_proxy.c @@ -198,7 +198,7 @@ dhcp_proxy_server_add (fib_protocol_t proto, rx_fib_index, ~0); pool_get (dpm->dhcp_servers[proto], proxy); - memset (proxy, 0, sizeof (*proxy)); + clib_memset (proxy, 0, sizeof (*proxy)); new = 1; dpm->dhcp_server_index_by_rx_fib_index[proto][rx_fib_index] = |