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/fakeidentd.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/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 0e543e772..04138cca3 100644 --- a/networking/fakeidentd.c +++ b/networking/fakeidentd.c | |||
@@ -77,17 +77,16 @@ static void inetbind(void) | |||
77 | int s, port; | 77 | int s, port; |
78 | struct sockaddr_in addr; | 78 | struct sockaddr_in addr; |
79 | int len = sizeof(addr); | 79 | int len = sizeof(addr); |
80 | int one = 1; | ||
81 | struct servent *se; | 80 | struct servent *se; |
82 | 81 | ||
83 | if ((se = getservbyname("identd", "tcp")) == NULL) | 82 | se = getservbyname("identd", "tcp"); |
84 | port = IDENT_PORT; | 83 | port = IDENT_PORT; |
85 | else | 84 | if (se) |
86 | port = se->s_port; | 85 | port = se->s_port; |
87 | 86 | ||
88 | s = xsocket(AF_INET, SOCK_STREAM, 0); | 87 | s = xsocket(AF_INET, SOCK_STREAM, 0); |
89 | 88 | ||
90 | setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)); | 89 | setsockopt_reuseaddr(s); |
91 | 90 | ||
92 | memset(&addr, 0, sizeof(addr)); | 91 | memset(&addr, 0, sizeof(addr)); |
93 | addr.sin_addr.s_addr = inet_addr(bind_ip_address); | 92 | addr.sin_addr.s_addr = inet_addr(bind_ip_address); |