fix the test program bug in no_ipv4: true

This commit is contained in:
Sukchan Lee
2017-12-09 04:42:42 +00:00
parent fc4a89b678
commit b04d930f77

View File

@@ -202,8 +202,12 @@ status_t testgtpu_enb_send(c_uint32_t src_ip, c_uint32_t dst_ip)
if (bearer->sgw_s1u_ip.ipv6)
{
sgw.c_sa_family = AF_INET6;
memcpy(sgw.sin6.sin6_addr.s6_addr,
bearer->sgw_s1u_ip.both.addr6, IPV6_LEN);
if (bearer->sgw_s1u_ip.ipv4)
memcpy(sgw.sin6.sin6_addr.s6_addr,
bearer->sgw_s1u_ip.both.addr6, IPV6_LEN);
else
memcpy(sgw.sin6.sin6_addr.s6_addr,
bearer->sgw_s1u_ip.addr6, IPV6_LEN);
rv = sock_fill_scope_id_in_local(&sgw);
d_assert(rv == CORE_OK, return CORE_ERROR,);
}