aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat64_db.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2018-10-17 10:38:51 -0400
committerDamjan Marion <dmarion@me.com>2018-10-23 13:06:46 +0000
commitb7b929931a07fbb27b43d5cd105f366c3e29807e (patch)
tree438681c89738802dbb5d339715b96ea2c31bafb4 /src/plugins/nat/nat64_db.c
parentb9a4c445c1d4e9cdab476a8e1fb8a46ff0fc6080 (diff)
c11 safe string handling support
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/plugins/nat/nat64_db.c')
-rw-r--r--src/plugins/nat/nat64_db.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/plugins/nat/nat64_db.c b/src/plugins/nat/nat64_db.c
index 9ff68c80282..bb327a57152 100644
--- a/src/plugins/nat/nat64_db.c
+++ b/src/plugins/nat/nat64_db.c
@@ -86,7 +86,7 @@ nat64_db_bib_entry_create (nat64_db_t * db, ip6_address_t * in_addr,
db->bib.bib_entries_num++;
- memset (bibe, 0, sizeof (*bibe));
+ clib_memset (bibe, 0, sizeof (*bibe));
bibe->in_addr.as_u64[0] = in_addr->as_u64[0];
bibe->in_addr.as_u64[1] = in_addr->as_u64[1];
bibe->in_port = in_port;
@@ -108,7 +108,7 @@ nat64_db_bib_entry_create (nat64_db_t * db, ip6_address_t * in_addr,
kv.key[2] = bibe_key.as_u64[2];
clib_bihash_add_del_24_8 (&db->bib.in2out, &kv, 1);
- memset (&bibe_key.addr, 0, sizeof (bibe_key.addr));
+ clib_memset (&bibe_key.addr, 0, sizeof (bibe_key.addr));
bibe_key.addr.ip4.as_u32 = bibe->out_addr.as_u32;
bibe_key.fib_index = 0;
bibe_key.port = bibe->out_port;
@@ -179,7 +179,7 @@ nat64_db_bib_entry_free (nat64_db_t * db, nat64_db_bib_entry_t * bibe)
kv.key[2] = bibe_key.as_u64[2];
clib_bihash_add_del_24_8 (&db->bib.in2out, &kv, 0);
- memset (&bibe_key.addr, 0, sizeof (bibe_key.addr));
+ clib_memset (&bibe_key.addr, 0, sizeof (bibe_key.addr));
bibe_key.addr.ip4.as_u32 = bibe->out_addr.as_u32;
bibe_key.fib_index = 0;
bibe_key.port = bibe->out_port;
@@ -407,7 +407,7 @@ nat64_db_st_entry_create (nat64_db_t * db, nat64_db_bib_entry_t * bibe,
db->st.st_entries_num++;
- memset (ste, 0, sizeof (*ste));
+ clib_memset (ste, 0, sizeof (*ste));
ste->in_r_addr.as_u64[0] = in_r_addr->as_u64[0];
ste->in_r_addr.as_u64[1] = in_r_addr->as_u64[1];
ste->out_r_addr.as_u32 = out_r_addr->as_u32;
@@ -419,7 +419,7 @@ nat64_db_st_entry_create (nat64_db_t * db, nat64_db_bib_entry_t * bibe,
bibe->ses_num++;
/* create hash lookup */
- memset (&ste_key, 0, sizeof (ste_key));
+ clib_memset (&ste_key, 0, sizeof (ste_key));
ste_key.l_addr.as_u64[0] = bibe->in_addr.as_u64[0];
ste_key.l_addr.as_u64[1] = bibe->in_addr.as_u64[1];
ste_key.r_addr.as_u64[0] = ste->in_r_addr.as_u64[0];
@@ -436,7 +436,7 @@ nat64_db_st_entry_create (nat64_db_t * db, nat64_db_bib_entry_t * bibe,
kv.key[5] = ste_key.as_u64[5];
clib_bihash_add_del_48_8 (&db->st.in2out, &kv, 1);
- memset (&ste_key, 0, sizeof (ste_key));
+ clib_memset (&ste_key, 0, sizeof (ste_key));
ste_key.l_addr.ip4.as_u32 = bibe->out_addr.as_u32;
ste_key.r_addr.ip4.as_u32 = ste->out_r_addr.as_u32;
ste_key.l_port = bibe->out_port;
@@ -491,7 +491,7 @@ nat64_db_st_entry_free (nat64_db_t * db, nat64_db_st_entry_t * ste)
db->st.st_entries_num--;
/* delete hash lookup */
- memset (&ste_key, 0, sizeof (ste_key));
+ clib_memset (&ste_key, 0, sizeof (ste_key));
ste_key.l_addr.as_u64[0] = bibe->in_addr.as_u64[0];
ste_key.l_addr.as_u64[1] = bibe->in_addr.as_u64[1];
ste_key.r_addr.as_u64[0] = ste->in_r_addr.as_u64[0];
@@ -508,7 +508,7 @@ nat64_db_st_entry_free (nat64_db_t * db, nat64_db_st_entry_t * ste)
kv.key[5] = ste_key.as_u64[5];
clib_bihash_add_del_48_8 (&db->st.in2out, &kv, 0);
- memset (&ste_key, 0, sizeof (ste_key));
+ clib_memset (&ste_key, 0, sizeof (ste_key));
ste_key.l_addr.ip4.as_u32 = bibe->out_addr.as_u32;
ste_key.r_addr.ip4.as_u32 = ste->out_r_addr.as_u32;
ste_key.l_port = bibe->out_port;
@@ -565,7 +565,7 @@ nat64_db_st_entry_find (nat64_db_t * db, ip46_address_t * l_addr,
break;
}
- memset (&ste_key, 0, sizeof (ste_key));
+ clib_memset (&ste_key, 0, sizeof (ste_key));
ste_key.l_addr.as_u64[0] = l_addr->as_u64[0];
ste_key.l_addr.as_u64[1] = l_addr->as_u64[1];
ste_key.r_addr.as_u64[0] = r_addr->as_u64[0];