diff options
author | Neale Ranns <nranns@cisco.com> | 2020-02-24 13:32:30 +0000 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2020-03-17 14:04:02 +0000 |
commit | 3ec09e9243dceb78e7548725281b0da8eddf72b1 (patch) | |
tree | fb591d687ea796751b523bfd69cd96c127a9e75b /src/vnet/lisp-cp | |
parent | 68449850783ed6a2570a864b2d12c79ff35c4072 (diff) |
ip: ip_address_t uses ip46_address_t
Type: improvement
type re-use.
Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ic2a2e6babf9ae66a1e53aec53a6cd157e1893dc8
Diffstat (limited to 'src/vnet/lisp-cp')
-rw-r--r-- | src/vnet/lisp-cp/control.c | 6 | ||||
-rw-r--r-- | src/vnet/lisp-cp/gid_dictionary.c | 6 | ||||
-rw-r--r-- | src/vnet/lisp-cp/lisp_types.c | 4 |
3 files changed, 9 insertions, 7 deletions
diff --git a/src/vnet/lisp-cp/control.c b/src/vnet/lisp-cp/control.c index e4015c76fce..09f5c0a652d 100644 --- a/src/vnet/lisp-cp/control.c +++ b/src/vnet/lisp-cp/control.c @@ -134,13 +134,15 @@ ip_address_to_fib_prefix (const ip_address_t * addr, fib_prefix_t * prefix) prefix->fp_len = 32; prefix->fp_proto = FIB_PROTOCOL_IP4; clib_memset (&prefix->fp_addr.pad, 0, sizeof (prefix->fp_addr.pad)); - memcpy (&prefix->fp_addr.ip4, &addr->ip, sizeof (prefix->fp_addr.ip4)); + memcpy (&prefix->fp_addr.ip4, &addr->ip.ip4, + sizeof (prefix->fp_addr.ip4)); } else { prefix->fp_len = 128; prefix->fp_proto = FIB_PROTOCOL_IP6; - memcpy (&prefix->fp_addr.ip6, &addr->ip, sizeof (prefix->fp_addr.ip6)); + memcpy (&prefix->fp_addr.ip6, &addr->ip.ip6, + sizeof (prefix->fp_addr.ip6)); } prefix->___fp___pad = 0; } diff --git a/src/vnet/lisp-cp/gid_dictionary.c b/src/vnet/lisp-cp/gid_dictionary.c index c1b4adacf22..564ee8ea84d 100644 --- a/src/vnet/lisp-cp/gid_dictionary.c +++ b/src/vnet/lisp-cp/gid_dictionary.c @@ -346,13 +346,13 @@ make_arp_ndp_key (BVT (clib_bihash_kv) * kv, u32 bd, ip_address_t * addr) kv->key[0] = ((u64) bd << 32) | (u32) ip_addr_version (addr); if (ip_addr_version (addr) == AF_IP4) { - kv->key[1] = (u64) addr->ip.v4.as_u32; + kv->key[1] = (u64) ip_addr_v4 (addr).as_u32; kv->key[2] = (u64) 0; } else { - kv->key[1] = (u64) addr->ip.v6.as_u64[0]; - kv->key[2] = (u64) addr->ip.v6.as_u64[1]; + kv->key[1] = (u64) ip_addr_v6 (addr).as_u64[0]; + kv->key[2] = (u64) ip_addr_v6 (addr).as_u64[1]; } } diff --git a/src/vnet/lisp-cp/lisp_types.c b/src/vnet/lisp-cp/lisp_types.c index 90878654573..971d3071b6a 100644 --- a/src/vnet/lisp-cp/lisp_types.c +++ b/src/vnet/lisp-cp/lisp_types.c @@ -472,7 +472,7 @@ ip_address_put (u8 * b, ip_address_t * a) u32 len = ip_address_size (a); *(u16 *) b = clib_host_to_net_u16 (ip_address_iana_afi (a)); u8 *p = b + sizeof (u16); - clib_memcpy (p, &ip_addr_addr (a), len); + clib_memcpy (p, ip_addr_bytes (a), len); return (len + sizeof (u16)); } @@ -481,7 +481,7 @@ ip_address_parse (void *offset, u16 iana_afi, ip_address_t * dst) { ip_addr_version (dst) = ip_iana_afi_to_version (iana_afi); u8 size = ip_version_to_size (ip_addr_version (dst)); - clib_memcpy (&ip_addr_addr (dst), offset + sizeof (u16), size); + clib_memcpy (ip_addr_bytes (dst), offset + sizeof (u16), size); return (sizeof (u16) + size); } |