diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-23 02:22:06 +0300 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-23 02:22:06 +0300 |
commit | 48237b0c88343154d58854020c3a9c8b07c61b10 (patch) | |
tree | b36bc84f22dd797b45c8d665e50e2f6c690e1370 /networking/dnsd.c | |
parent | b40bdb383a6b7a7f0fd36d0b1cc24deb42cd5f0d (diff) |
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) 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; |