diff options
author | Denis Vlasenko | 2006-11-22 23:22:06 +0000 |
---|---|---|
committer | Denis Vlasenko | 2006-11-22 23:22:06 +0000 |
commit | 48237b0c88343154d58854020c3a9c8b07c61b10 (patch) | |
tree | b36bc84f22dd797b45c8d665e50e2f6c690e1370 /networking/fakeidentd.c | |
parent | b40bdb383a6b7a7f0fd36d0b1cc24deb42cd5f0d (diff) | |
download | busybox-48237b0c88343154d58854020c3a9c8b07c61b10.zip busybox-48237b0c88343154d58854020c3a9c8b07c61b10.tar.gz |
introduce setsockopt_reuseaddr(int fd), setsockopt_broadcast(int fd),
use them where appropriate. 200 bytes saved
Diffstat (limited to 'networking/fakeidentd.c')
-rw-r--r-- | networking/fakeidentd.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/networking/fakeidentd.c b/networking/fakeidentd.c index 0e543e7..04138cc 100644 --- a/networking/fakeidentd.c +++ b/networking/fakeidentd.c @@ -77,17 +77,16 @@ static void inetbind(void) int s, port; struct sockaddr_in addr; int len = sizeof(addr); - int one = 1; struct servent *se; - if ((se = getservbyname("identd", "tcp")) == NULL) - port = IDENT_PORT; - else + se = getservbyname("identd", "tcp"); + port = IDENT_PORT; + if (se) port = se->s_port; s = xsocket(AF_INET, SOCK_STREAM, 0); - setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)); + setsockopt_reuseaddr(s); memset(&addr, 0, sizeof(addr)); addr.sin_addr.s_addr = inet_addr(bind_ip_address); |