Could you please help us by creating the ticket with IBM? It would be a great help.
Thanks in advance!
Original Message:
Sent: Wed June 11, 2025 02:47 PM
From: Andrey Klyachkin
Subject: getifaddrs
Hi José,
thank you! Somehow, I missed it. I searched through the headers and didn't find any definitions for the function. Then I looked for exported symbols in libc.a, it was not there either. IBM decided to create a new library...
I did a small test. I created the header file:
#ifndef IFADDRS_H#define IFADDRS_Hstruct ifaddrs{ struct ifaddrs *ifa_next; char *ifa_name; u_int ifa_flags; struct sockaddr *ifa_addr; struct sockaddr *ifa_netmask; union { struct sockaddr *ifu_broadaddr; struct sockaddr *ifu_dstaddr; } ifa_ifu; void *ifa_data;};int getifaddrs(struct ifaddrs **ifap);void freeifaddrs(struct ifaddrs *ifap);#endif
I've got the functions definitions from IBM i documentation - https://www.ibm.com/docs/en/i/7.1.0?topic=ssw_ibm_i_71/apis/getifaddrs.html
Then I took the example from the IBM i documentation and compiled it on AIX 7.3 TL3.
# gcc -o ifaddrs ifaddrs.c -lifaddrs
The result is, as Murarisetty reported, without aliases. It shows only the first IP address on the interface.
I took the same code to Linux. The only change - I don't need my getifaddrs.h on Linux. I can use the system file. It showed me the alias on the interface:
Internet Address: 10.10.10.10 LineDescription : ens192 Netmask : 255.255.254.0 Broadcast Addr : 10.10.10.255 Internet Address: 10.20.20.20 LineDescription : ens192 Netmask : 255.255.254.0 Broadcast Addr : 10.20.20.20
Note that it shows the wrong broadcast address for the alias on Linux.
It looks like the undocumented implementation of getifaddrs() on AIX is buggy. works as designed.
Please open a ticket at IBM...
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Wed June 11, 2025 01:13 PM
From: José Pina Coelho
Subject: getifaddrs
Hi Andrey, it seems to be a recent addition to AIX. Either to be compatible with BSD or glibc.
I find it in /usr/lib/libifaddrs.{a,exp} - exporting 2 symbols: getifaddrs, freeifaddrs - on AIX 7300-03-00-2446 and 7300-02-02-2420. It's provided by bos.net.tcp.server_core, but not documented.
From it's history:
This function first appeared in BSDi and ispresent on the BSD systems, but with slightly differentsemantics documented\[em]returning one entry per interface,not per address.
https://linux.die.net/man/3/getifaddrs
https://man.freebsd.org/cgi/man.cgi?getifaddrs
------------------------------
José Pina Coelho
IT Specialist at Kyndryl
Original Message:
Sent: Wed June 11, 2025 06:36 AM
From: Andrey Klyachkin
Subject: getifaddrs
Hi Murarisetty,
I think I am missing a context here. What do you mean? The C function getifaddrs()? As far as I know, it doesn't exist on AIX in the standard package. Can you give more details what you want to achieve?
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Tue June 10, 2025 08:50 AM
From: Murarisetty guptha
Subject: getifaddrs
Does this return on all tha associated IPs on the same interface, When I checked it's only returning the primary one...?
------------------------------
Murarisetty guptha
------------------------------