Merge remote-tracking branch 'origin/hotfix-ip-address-lte-ue' into integration_2025_w16 (!3390)

fix IP address in 4G UE

The following error was appearing when running LTE UE:

inet_pton(): cannot convert -64.-74.0.2 to IPv4 network address

The allocated address by the core actually is 192.182.0.2.
On my host "char" is signed, leading to the above error (192 and 182
are seen as signed).
Let's force "ip_addr" unsigned and everyone is happy.
This commit is contained in:
Jaroslava Fiedlerova
2025-04-18 08:10:28 +02:00
+1 -1
View File
@@ -204,7 +204,7 @@ int esm_ebr_context_create(
// etc
case NET_PDN_TYPE_IPV4: {
char ip[20];
char *ip_addr = pdn->ip_addr;
unsigned char *ip_addr = (unsigned char *)pdn->ip_addr;
snprintf(ip, sizeof(ip), "%d.%d.%d.%d", ip_addr[0], ip_addr[1], ip_addr[2], ip_addr[3]);
const char *ifn = get_softmodem_params()->nsa ? "oaitun_nru" : "oaitun_ue";
char ifname[IFNAMSIZ];