aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-07-27 19:37:59 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-27 19:37:59 -0400
commit839c5d2511fadc35cc4e8a8ffa833d76668700b2 (patch)
tree8c5150c50dba619ec88818e1610263582d476217 /net/core
parent96fad28a781069eb40156f78b8f50c349805b652 (diff)
parent5e43db7730e7cef7d37968ea789c41392519a864 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'net/core')
-rw-r--r--net/core/sock.c13
-rw-r--r--net/core/utils.c37
2 files changed, 43 insertions, 7 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index 8b35ccdc2b3b..12f6d9a2a522 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -206,13 +206,14 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
206 */ 206 */
207 207
208#ifdef SO_DONTLINGER /* Compatibility item... */ 208#ifdef SO_DONTLINGER /* Compatibility item... */
209 switch (optname) { 209 if (optname == SO_DONTLINGER) {
210 case SO_DONTLINGER: 210 lock_sock(sk);
211 sock_reset_flag(sk, SOCK_LINGER); 211 sock_reset_flag(sk, SOCK_LINGER);
212 return 0; 212 release_sock(sk);
213 return 0;
213 } 214 }
214#endif 215#endif
215 216
216 if(optlen<sizeof(int)) 217 if(optlen<sizeof(int))
217 return(-EINVAL); 218 return(-EINVAL);
218 219
diff --git a/net/core/utils.c b/net/core/utils.c
index e11a8654f363..88eb8b68e26b 100644
--- a/net/core/utils.c
+++ b/net/core/utils.c
@@ -23,10 +23,10 @@
23#include <linux/percpu.h> 23#include <linux/percpu.h>
24#include <linux/init.h> 24#include <linux/init.h>
25 25
26#include <asm/byteorder.h>
26#include <asm/system.h> 27#include <asm/system.h>
27#include <asm/uaccess.h> 28#include <asm/uaccess.h>
28 29
29
30/* 30/*
31 This is a maximally equidistributed combined Tausworthe generator 31 This is a maximally equidistributed combined Tausworthe generator
32 based on code from GNU Scientific Library 1.5 (30 Jun 2004) 32 based on code from GNU Scientific Library 1.5 (30 Jun 2004)
@@ -153,3 +153,38 @@ int net_ratelimit(void)
153EXPORT_SYMBOL(net_random); 153EXPORT_SYMBOL(net_random);
154EXPORT_SYMBOL(net_ratelimit); 154EXPORT_SYMBOL(net_ratelimit);
155EXPORT_SYMBOL(net_srandom); 155EXPORT_SYMBOL(net_srandom);
156
157/*
158 * Convert an ASCII string to binary IP.
159 * This is outside of net/ipv4/ because various code that uses IP addresses
160 * is otherwise not dependent on the TCP/IP stack.
161 */
162
163__u32 in_aton(const char *str)
164{
165 unsigned long l;
166 unsigned int val;
167 int i;
168
169 l = 0;
170 for (i = 0; i < 4; i++)
171 {
172 l <<= 8;
173 if (*str != '\0')
174 {
175 val = 0;
176 while (*str != '\0' && *str != '.')
177 {
178 val *= 10;
179 val += *str - '0';
180 str++;
181 }
182 l |= val;
183 if (*str != '\0')
184 str++;
185 }
186 }
187 return(htonl(l));
188}
189
190EXPORT_SYMBOL(in_aton);