diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-22 23:22:06 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-22 23:22:06 +0000 |
commit | 48237b0c88343154d58854020c3a9c8b07c61b10 (patch) | |
tree | b36bc84f22dd797b45c8d665e50e2f6c690e1370 /networking/dnsd.c | |
parent | b40bdb383a6b7a7f0fd36d0b1cc24deb42cd5f0d (diff) | |
download | busybox-w32-48237b0c88343154d58854020c3a9c8b07c61b10.tar.gz busybox-w32-48237b0c88343154d58854020c3a9c8b07c61b10.tar.bz2 busybox-w32-48237b0c88343154d58854020c3a9c8b07c61b10.zip |
introduce setsockopt_reuseaddr(int fd), setsockopt_broadcast(int fd),
use them where appropriate. 200 bytes saved
Diffstat (limited to 'networking/dnsd.c')
-rw-r--r-- | networking/dnsd.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/networking/dnsd.c b/networking/dnsd.c index 6f9dc5d67..5e9cf52f1 100644 --- a/networking/dnsd.c +++ b/networking/dnsd.c | |||
@@ -200,12 +200,9 @@ static int listen_socket(char *iface_addr, int listen_port) | |||
200 | struct sockaddr_in a; | 200 | struct sockaddr_in a; |
201 | char msg[100]; | 201 | char msg[100]; |
202 | int s; | 202 | int s; |
203 | int yes = 1; | ||
204 | s = xsocket(PF_INET, SOCK_DGRAM, 0); | 203 | s = xsocket(PF_INET, SOCK_DGRAM, 0); |
205 | #ifdef SO_REUSEADDR | 204 | if (setsockopt_reuseaddr(s) < 0) |
206 | if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&yes, sizeof(yes)) < 0) | ||
207 | bb_perror_msg_and_die("setsockopt() failed"); | 205 | bb_perror_msg_and_die("setsockopt() failed"); |
208 | #endif | ||
209 | memset(&a, 0, sizeof(a)); | 206 | memset(&a, 0, sizeof(a)); |
210 | a.sin_port = htons(listen_port); | 207 | a.sin_port = htons(listen_port); |
211 | a.sin_family = AF_INET; | 208 | a.sin_family = AF_INET; |