Problems with SO_BINDTODEVICE Linux socket option
I have been looking into this for a while after seeing conflicting answers to how SO_BINDTODEVICE is actually used. Some sources claim that the correct usage is to pass in a struct ifreq pointer, which has the device name and index obtained via an ioctl. For example: struct ifreq ifr; memset(&ifr, 0, sizeof(struct ifreq)); snprintf(ifr.ifr_name, … Read more