Summary: | Linux(4) getifaddrs() results in Address family not supported by protocol getifaddrs() (EAFNOSUPPORT) | ||
---|---|---|---|
Product: | Base System | Reporter: | Didier Garcin <didu31> |
Component: | kern | Assignee: | Alexander V. Chernikov <melifaro> |
Status: | Closed FIXED | ||
Severity: | Affects Many People | CC: | dchagin, emaste, trasz |
Priority: | --- | Keywords: | needs-qa |
Version: | 13.0-RELEASE | Flags: | koobs:
maintainer-feedback?
(trasz) koobs: maintainer-feedback? (dchagin) koobs: mfc-stable13? koobs: mfc-stable12? koobs: mfc-stable11- |
Hardware: | amd64 | ||
OS: | Any |
Description
Didier Garcin
2021-10-23 10:27:05 UTC
#include <errno.h> #include <stdio.h> #include <ifaddrs.h> #include <sys/socket.h> int main(int argc, char** argv) { struct ifaddrs *addrs, *ent; if (getifaddrs(&addrs)) printf("errno = %d\n", errno); int count = 0; /* Count the number of interfaces */ for (ent = addrs; ent; ent = ent->ifa_next) { count++; /* ERRATUM */ printf("\"%s\" af_family = %d\n", ent->ifa_name, ent->ifa_addr->sa_family); } freeifaddrs(addrs); } (In reply to Didier Garcin from comment #1) Can you capture and attach ktrace/strace from running the sample under the Linuxulator? Also, what happens if you run your sample on real Linux? (In reply to Ed Maste from comment #2) I'm sorry, strace is suspended automatically without producing any log : debian$ strace ./if ^C debian$ debian$ strace ./if & [1] 25885 didier@teahupoo:~/labo$ debian$ ps PID TTY TIME CMD 26803 pts/1 00:00:00 ps 26436 pts/1 00:00:00 strace 25885 pts/1 00:00:00 strace 70426 pts/1 00:00:00 bash debian$ On host : freebsd-13% sudo ps -a PID TT STAT TIME COMMAND . . . 25885 1 I 0:00,00 strace ./if 26436 1 TX 0:00,00 strace ./if 69793 1 I 0:00,01 sudo chroot debian /bin/bash . . . AFAIRemember, from some time glibc use NETLINK for getifaddrs, it in my queue, but for first in my POV we need modify domain code to allow detaching of protocol family. I think it’s possible for now after epoch (In reply to Dmitry Chagin from comment #4) Very good news !! over to netlink author merged into the stable/13, thanks too melifaro@ |