diff --git a/src/net_socket.c b/src/net_socket.c index c8aa7882..4737f0c6 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -122,8 +122,8 @@ static bool bind_to_interface(int sd) { #if defined(SOL_SOCKET) && defined(SO_BINDTODEVICE) memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_ifrn.ifrn_name, iface, IFNAMSIZ); - ifr.ifr_ifrn.ifrn_name[IFNAMSIZ - 1] = 0; + strncpy(ifr.ifr_name, iface, IFNAMSIZ); + ifr.ifr_name[IFNAMSIZ - 1] = 0; status = setsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, (void *)&ifr, sizeof(ifr)); @@ -233,8 +233,8 @@ int setup_listen_socket(const sockaddr_t *sa) { struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_ifrn.ifrn_name, iface, IFNAMSIZ); - ifr.ifr_ifrn.ifrn_name[IFNAMSIZ - 1] = 0; + strncpy(ifr.ifr_name, iface, IFNAMSIZ); + ifr.ifr_name[IFNAMSIZ - 1] = 0; if(setsockopt(nfd, SOL_SOCKET, SO_BINDTODEVICE, (void *)&ifr, sizeof(ifr))) { closesocket(nfd); diff --git a/src/raw_socket_device.c b/src/raw_socket_device.c index 1c455e6a..dc444207 100644 --- a/src/raw_socket_device.c +++ b/src/raw_socket_device.c @@ -55,8 +55,8 @@ static bool setup_device(void) { fcntl(device_fd, F_SETFD, FD_CLOEXEC); #endif - strncpy(ifr.ifr_ifrn.ifrn_name, iface, IFNAMSIZ); - ifr.ifr_ifrn.ifrn_name[IFNAMSIZ - 1] = 0; + strncpy(ifr.ifr_name, iface, IFNAMSIZ); + ifr.ifr_name[IFNAMSIZ - 1] = 0; if(ioctl(device_fd, SIOCGIFINDEX, &ifr)) { close(device_fd);