summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-09-14 12:16:02 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-09-14 12:16:02 +0200
commit95e2ec698d1f4845d16cf9e704bf857a13f71e6f (patch)
treec20b9f7ad348b602f8968c80fa50bd05af7444db
parentb114b73e5d22e3f9b396fa6af42d64b0b6cb7a02 (diff)
sua: Support SUA_IEI_IPv6
-rw-r--r--src/sua.c8
-rw-r--r--src/xua_msg.c2
2 files changed, 8 insertions, 2 deletions
diff --git a/src/sua.c b/src/sua.c
index 4835665..4a98b9a 100644
--- a/src/sua.c
+++ b/src/sua.c
@@ -467,6 +467,13 @@ int sua_addr_parse_part(struct osmo_sccp_addr *out,
out->ip.v4.s_addr = *p32;
out->presence |= OSMO_SCCP_ADDR_T_IPv4;
break;
+ case SUA_IEI_IPv6:
+ if (par_datalen != 16)
+ goto subpar_fail;
+ /* no endian conversion, both network order */
+ memcpy(&out->ip.v6, par->data, 16);
+ out->presence |= OSMO_SCCP_ADDR_T_IPv6;
+ break;
default:
LOGP(DLSUA, LOGL_ERROR, "SUA IEI 0x%04x: Unknown subpart tag %hd\n",
param->tag, par_tag);
@@ -739,4 +746,3 @@ out:
return rc;
}
-
diff --git a/src/xua_msg.c b/src/xua_msg.c
index 91adcf1..75e1357 100644
--- a/src/xua_msg.c
+++ b/src/xua_msg.c
@@ -378,7 +378,7 @@ int xua_msg_add_sccp_addr(struct xua_msg *xua, uint16_t iei, const struct osmo_s
if (addr->presence & OSMO_SCCP_ADDR_T_IPv4) {
msgb_t16l16vp_put_u32(tmp, SUA_IEI_IPv4, ntohl(addr->ip.v4.s_addr));
} else if (addr->presence & OSMO_SCCP_ADDR_T_IPv6) {
- /* FIXME: IPv6 address */
+ msgb_t16l16vp_put(tmp, SUA_IEI_IPv6, sizeof(addr->ip.v6), (const uint8_t *)&addr->ip.v6);
}
rc = xua_msg_add_data(xua, iei, msgb_length(tmp), tmp->data);
msgb_free(tmp);