diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-12-10 14:12:16 +0300 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-12-10 14:12:16 +0300 |
commit | e53738558f2f1aa8cd536545479ab98b0df808c5 (patch) | |
tree | 187265ed8377d2eee805dc7cc6b9150774804805 /networking/arping.c | |
parent | 0d94820adf87b752c338c194a7291dcf1b96fc76 (diff) |
*: fix SO_BINDTODEVICE. Kernel wants at least IFNAMSIZ bytes there.
Diffstat (limited to 'networking/arping.c')
-rw-r--r-- | networking/arping.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/networking/arping.c b/networking/arping.c index e7b842f5b..915af3261 100644 --- a/networking/arping.c +++ b/networking/arping.c @@ -331,8 +331,7 @@ int arping_main(int argc UNUSED_PARAM, char **argv) struct sockaddr_in saddr; int probe_fd = xsocket(AF_INET, SOCK_DGRAM, 0); - if (setsockopt(probe_fd, SOL_SOCKET, SO_BINDTODEVICE, device, strlen(device) + 1) == -1) - bb_perror_msg("cannot bind to device %s", device); + setsockopt_bindtodevice(probe_fd, device); memset(&saddr, 0, sizeof(saddr)); saddr.sin_family = AF_INET; if (src.s_addr) { |