diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2023-01-31 17:57:25 +0100 |
---|---|---|
committer | Philipp Maier <pmaier@sysmocom.de> | 2023-02-02 10:52:51 +0100 |
commit | 16b891ffb98d3c6ff0ce70a54997ecadaf1688f8 (patch) | |
tree | 5954f0f68d20f1ff6ff4386481935e6e5eff0d1e | |
parent | 97ed3c8d971f3c231a1303efe61b3f98116f1e2f (diff) |
pcu_sock: fix endianess when populating gsm_pcu_if_info_ind
The intended endienaess for the remote_port member is host byte order,
while the endianess in the nsvc struct is in network byte order.
(see also pcu_sock.c in osmo-bts.git)
Change-Id: Ib62dcceb80fd500e477dd5e1a0e43de47e16eeb0
Related: OS#5198
-rw-r--r-- | src/osmo-bsc/pcu_sock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c index def2df069..800b6fdc0 100644 --- a/src/osmo-bsc/pcu_sock.c +++ b/src/osmo-bsc/pcu_sock.c @@ -263,14 +263,14 @@ static int pcu_tx_info_ind(struct gsm_bts *bts) case AF_INET: info_ind->address_type[i] = PCU_IF_ADDR_TYPE_IPV4; info_ind->remote_ip[i].v4 = nsvc->remote.u.sin.sin_addr; - info_ind->remote_port[i] = nsvc->remote.u.sin.sin_port; + info_ind->remote_port[i] = ntohs(nsvc->remote.u.sin.sin_port); break; case AF_INET6: info_ind->address_type[i] = PCU_IF_ADDR_TYPE_IPV6; memcpy(&info_ind->remote_ip[i].v6, &nsvc->remote.u.sin6.sin6_addr, sizeof(struct in6_addr)); - info_ind->remote_port[i] = nsvc->remote.u.sin6.sin6_port; + info_ind->remote_port[i] = ntohs(nsvc->remote.u.sin6.sin6_port); break; default: info_ind->address_type[i] = PCU_IF_ADDR_TYPE_UNSPEC; |