*: fix SO_BINDTODEVICE. Kernel wants at least IFNAMSIZ bytes there.

This commit is contained in:
Denis Vlasenko
2008-12-10 11:12:16 +00:00
parent 0d94820adf
commit e53738558f
5 changed files with 21 additions and 6 deletions

View File

@@ -98,8 +98,8 @@ int FAST_FUNC udhcp_listen_socket(/*uint32_t ip,*/ int port, const char *inf)
bb_perror_msg_and_die("SO_BROADCAST");
/* NB: bug 1032 says this doesn't work on ethernet aliases (ethN:M) */
if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, &inf, strlen(inf) + 1) == -1)
bb_perror_msg_and_die("SO_BINDTODEVICE");
if (setsockopt_bindtodevice(fd, inf))
xfunc_die(); /* warning is already printed */
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;