diff options
Diffstat (limited to 'libbb/xconnect.c')
-rw-r--r-- | libbb/xconnect.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libbb/xconnect.c b/libbb/xconnect.c index 97751eb27..d8c8d02d5 100644 --- a/libbb/xconnect.c +++ b/libbb/xconnect.c | |||
@@ -21,6 +21,8 @@ int FAST_FUNC setsockopt_broadcast(int fd) | |||
21 | { | 21 | { |
22 | return setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &const_int_1, sizeof(const_int_1)); | 22 | return setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &const_int_1, sizeof(const_int_1)); |
23 | } | 23 | } |
24 | |||
25 | #ifdef SO_BINDTODEVICE | ||
24 | int FAST_FUNC setsockopt_bindtodevice(int fd, const char *iface) | 26 | int FAST_FUNC setsockopt_bindtodevice(int fd, const char *iface) |
25 | { | 27 | { |
26 | int r; | 28 | int r; |
@@ -36,6 +38,14 @@ int FAST_FUNC setsockopt_bindtodevice(int fd, const char *iface) | |||
36 | bb_perror_msg("can't bind to interface %s", iface); | 38 | bb_perror_msg("can't bind to interface %s", iface); |
37 | return r; | 39 | return r; |
38 | } | 40 | } |
41 | #else | ||
42 | int FAST_FUNC setsockopt_bindtodevice(int fd UNUSED_PARAM, | ||
43 | const char *iface UNUSED_PARAM) | ||
44 | { | ||
45 | bb_error_msg("SO_BINDTODEVICE is not supported on this system"); | ||
46 | return -1; | ||
47 | } | ||
48 | #endif | ||
39 | 49 | ||
40 | len_and_sockaddr* FAST_FUNC get_sock_lsa(int fd) | 50 | len_and_sockaddr* FAST_FUNC get_sock_lsa(int fd) |
41 | { | 51 | { |