Hooking getaddrinfo to Test IPv4 Priority on Debian 13
Preface Group members reported that IPv4 priority cannot be set on Debian 13 Analysis Thanks to the group members of the Debian Chinese group for providing the information https://t.me/c/1039975886/766705 Thanks to the group members of the 233 group for providing the information https://t.me/tg233boy/1228524 Now we know that gai.conf controls the behavior of the getaddrinfo system interface /etc/gai.conf How can we prove that a certain program calls getaddrinfo (controlled by gai.conf)? Hooking to intercept system interface calls Thanks to the inspiration from the group members of the Debian Chinese group https://t.me/c/1039975886/766779 I don't know how to use gdb for debugging, but I know how to compile. I asked GPT, and the library for getaddrinfo is libc.so.6 You can find the getaddrinfo symbol here, e.g. nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep getaddrinfo I originally wanted to find the source code and compile a copy of libc.so.6 myself. The idea was to not affect the or...