aboutsummaryrefslogtreecommitdiff
path: root/networking/dnsd.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-11-22 23:22:06 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-11-22 23:22:06 +0000
commit48237b0c88343154d58854020c3a9c8b07c61b10 (patch)
treeb36bc84f22dd797b45c8d665e50e2f6c690e1370 /networking/dnsd.c
parentb40bdb383a6b7a7f0fd36d0b1cc24deb42cd5f0d (diff)
downloadbusybox-48237b0c88343154d58854020c3a9c8b07c61b10.tar.gz
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.c5
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)
struct sockaddr_in a;
char msg[100];
int s;
- int yes = 1;
s = xsocket(PF_INET, SOCK_DGRAM, 0);
-#ifdef SO_REUSEADDR
- if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&yes, sizeof(yes)) < 0)
+ if (setsockopt_reuseaddr(s) < 0)
bb_perror_msg_and_die("setsockopt() failed");
-#endif
memset(&a, 0, sizeof(a));
a.sin_port = htons(listen_port);
a.sin_family = AF_INET;