[Bug 174933] [linux] if_nameindex fail in linuxulator enviroment (PF_NETLINK needed)

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Jul 18 20:18:37 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=174933

--- Comment #7 from Alex S <iwtcex at gmail.com> ---
(In reply to pete from comment #6)

Hmm… Judging by the installer/demo disassembly, this syscall comes from the
function named GetMACAddressLIN, so intent is clear enough. The code mostly
involves socket(AF_INET, SOCK_DGRAM, IPPROTO_IP) + SIOCGIFFLAGS and
SIOCGIFHWADDR ioctls. However, there is also if_nameindex (obviously), which is
internally implemented in glibc with a PF_NETLINK socket. X-Plane is probably
only interested there in the name of the first returned interface. (Disclaimer:
I'm not actually good at reading assembly by any measure.)

If you are willing to spend your time on application-specific hacks, you should
try writing LD_PRELOADable variants for if_nameindex and if_freenameindex.
Either stub them or get the necessary information from linsysfs at
/sys/class/net.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-emulation mailing list