79287325

Date: 2024-12-17 09:40:47
Score: 1
Natty:
Report link
 struct ifreq ifr;
        memset(&ifr, 0, sizeof(ifr));
        snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "eth0");

        ioctl(s, SIOCGIFINDEX, &ifr)
        setsockopt(s, SOL_SOCKET, SO_BINDTODEVICE,  ifr.ifr_name, 16);
The length needs to be fixed to 16
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: didi yao