From b7b929931a07fbb27b43d5cd105f366c3e29807e Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Wed, 17 Oct 2018 10:38:51 -0400 Subject: c11 safe string handling support Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach --- src/vnet/dns/dns.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/vnet/dns') diff --git a/src/vnet/dns/dns.c b/src/vnet/dns/dns.c index eff854933c4..54b75aa1708 100644 --- a/src/vnet/dns/dns.c +++ b/src/vnet/dns/dns.c @@ -278,9 +278,9 @@ found_src_address: vnet_buffer (b)->sw_if_index[VLIB_TX] = 0; /* default VRF for now */ ip = vlib_buffer_get_current (b); - memset (ip, 0, sizeof (*ip)); + clib_memset (ip, 0, sizeof (*ip)); udp = (udp_header_t *) (ip + 1); - memset (udp, 0, sizeof (*udp)); + clib_memset (udp, 0, sizeof (*udp)); dns_request = (u8 *) (udp + 1); @@ -384,9 +384,9 @@ found_src_address: VLIB_BUFFER_TOTAL_LENGTH_VALID | VNET_BUFFER_F_LOCALLY_ORIGINATED; ip = vlib_buffer_get_current (b); - memset (ip, 0, sizeof (*ip)); + clib_memset (ip, 0, sizeof (*ip)); udp = (udp_header_t *) (ip + 1); - memset (udp, 0, sizeof (*udp)); + clib_memset (udp, 0, sizeof (*udp)); dns_request = (u8 *) (udp + 1); @@ -768,7 +768,7 @@ dns_add_static_entry (dns_main_t * dm, u8 * name, u8 * dns_reply_data) } pool_get (dm->entries, ep); - memset (ep, 0, sizeof (*ep)); + clib_memset (ep, 0, sizeof (*ep)); /* Note: consumes the name vector */ ep->name = name; @@ -887,7 +887,7 @@ re_resolve: /* add new hash table entry */ pool_get (dm->entries, ep); - memset (ep, 0, sizeof (*ep)); + clib_memset (ep, 0, sizeof (*ep)); ep->name = format (0, "%s%c", name, 0); _vec_len (ep->name) = vec_len (ep->name) - 1; @@ -1063,7 +1063,7 @@ found_last_request: /* Need to recompute ep post pool-get */ ep = pool_elt_at_index (dm->entries, ep_index); - memset (next_ep, 0, sizeof (*next_ep)); + clib_memset (next_ep, 0, sizeof (*next_ep)); next_ep->name = vec_dup (cname); vec_add1 (next_ep->name, 0); _vec_len (next_ep->name) -= 1; @@ -2592,7 +2592,7 @@ test_dns_fmt_command_fn (vlib_main_t * vm, vlib_cli_output (vm, "%U", format_dns_reply, dns_reply_data, verbose); - memset (rmp, 0, sizeof (*rmp)); + clib_memset (rmp, 0, sizeof (*rmp)); rv = vnet_dns_response_to_reply (dns_reply_data, rmp, 0 /* ttl-ptr */ ); @@ -2758,7 +2758,7 @@ vnet_send_dns4_reply (dns_main_t * dm, dns_pending_request_t * pr, if (pr->request_type == DNS_PEER_PENDING_NAME_TO_IP) { /* Quick and dirty way to dig up the A-record address. $$ FIXME */ - memset (rnr, 0, sizeof (*rnr)); + clib_memset (rnr, 0, sizeof (*rnr)); if (vnet_dns_response_to_reply (ep->dns_response, rnr, &ttl)) { /* clib_warning ("response_to_reply failed..."); */ @@ -2772,7 +2772,7 @@ vnet_send_dns4_reply (dns_main_t * dm, dns_pending_request_t * pr, } else if (pr->request_type == DNS_PEER_PENDING_IP_TO_NAME) { - memset (rir, 0, sizeof (*rir)); + clib_memset (rir, 0, sizeof (*rir)); if (vnet_dns_response_to_name (ep->dns_response, rir, &ttl)) { /* clib_warning ("response_to_name failed..."); */ @@ -2859,7 +2859,7 @@ found_src_address: ip = vlib_buffer_get_current (b0); udp = (udp_header_t *) (ip + 1); dns_response = (u8 *) (udp + 1); - memset (ip, 0, sizeof (*ip) + sizeof (*udp)); + clib_memset (ip, 0, sizeof (*ip) + sizeof (*udp)); /* * Start with the variadic portion of the exercise. -- cgit 1.2.3-korg