summaryrefslogtreecommitdiff
path: root/networking/fakeidentd.c
diff options
context:
space:
mode:
authorDenis Vlasenko2006-11-22 23:22:06 +0000
committerDenis Vlasenko2006-11-22 23:22:06 +0000
commit48237b0c88343154d58854020c3a9c8b07c61b10 (patch)
treeb36bc84f22dd797b45c8d665e50e2f6c690e1370 /networking/fakeidentd.c
parentb40bdb383a6b7a7f0fd36d0b1cc24deb42cd5f0d (diff)
downloadbusybox-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.c9
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);