Date: Sat, 23 Oct 2021 10:27:05 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 259374] [Linux Compatibility Layer] : getifaddrs() : errno = EAFNOSUPPORT Message-ID: <bug-259374-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D259374 Bug ID: 259374 Summary: [Linux Compatibility Layer] : getifaddrs() : errno =3D EAFNOSUPPORT Product: Base System Version: 13.0-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Many People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: didu31@hotmail.fr Hi, interface with gnu/linux getifaddrs() is no perfect. This concerns at least interface with debian wheezy, buster and bulleyes kernels. freebsd-13% ifconfig bge0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 =20=20=20=20=20=20=20 options=3Dc019b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,VLAN= _HWTSO,LINKSTATE> ether 84:2b:2b:ae:6a:85 inet 192.168.0.45 netmask 0xffffff00 broadcast 192.168.0.255 media: Ethernet autoselect (100baseTX <full-duplex>) status: active nd6 options=3D23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL> lo0: flags=3D8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384 options=3D680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6> inet 127.0.0.1 netmask 0xff000000 groups: lo nd6 options=3D21<PERFORMNUD,AUTO_LINKLOCAL> And consider this snippet, if.c: #include <errno.h> #include <stdio.h> #include <ifaddrs.h> int main(int argc, char** argv) { struct ifaddrs *addrs, *ent; if (getifaddrs(&addrs)) { printf("errno =3D %d\n", errno); perror("getifaddrs()"); return 1; } int count =3D 0; /* Count the number of interfaces */ for (ent =3D addrs; ent; ent =3D ent->ifa_next)=20 { count++; } freeifaddrs(addrs); } freebsd-13% cc if.c -o if freebsd-13% ./if "bge0" af_family =3D 18 (=3D AF_LINK /* Link layer interface */) "bge0" af_family =3D 2 (=3D AF_INET) "lo0" af_family =3D 18 "lo0" af_family =3D 2 freebsd-13% sudo chroot compat/debian /bin/bash debian% cc if.c -o if debian% ./if errno =3D 97 (EAFNOSUPPORT) getifaddrs(): Address family not supported by protocol Could it be a compatibility bug with AF_LINK ? --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-259374-227>