]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/core/utils.c
Remove obsolete #include <linux/config.h>
[linux-2.6-omap-h63xx.git] / net / core / utils.c
index 88eb8b68e26b2c21b18a6e5f1256f24d6104d36c..4f96f389243d7d6322288609f6477c74eab5ac09 100644 (file)
@@ -16,7 +16,9 @@
 #include <linux/module.h>
 #include <linux/jiffies.h>
 #include <linux/kernel.h>
+#include <linux/inet.h>
 #include <linux/mm.h>
+#include <linux/net.h>
 #include <linux/string.h>
 #include <linux/types.h>
 #include <linux/random.h>
@@ -119,7 +121,7 @@ void __init net_random_init(void)
 {
        int i;
 
-       for (i = 0; i < NR_CPUS; i++) {
+       for_each_possible_cpu(i) {
                struct nrnd_state *state = &per_cpu(net_rand_state,i);
                __net_srandom(state, i+jiffies);
        }
@@ -131,7 +133,7 @@ static int net_random_reseed(void)
        unsigned long seed[NR_CPUS];
 
        get_random_bytes(seed, sizeof(seed));
-       for (i = 0; i < NR_CPUS; i++) {
+       for_each_possible_cpu(i) {
                struct nrnd_state *state = &per_cpu(net_rand_state,i);
                __net_srandom(state, seed[i]);
        }
@@ -160,7 +162,7 @@ EXPORT_SYMBOL(net_srandom);
  * is otherwise not dependent on the TCP/IP stack.
  */
 
-__u32 in_aton(const char *str)
+__be32 in_aton(const char *str)
 {
        unsigned long l;
        unsigned int val;
@@ -173,7 +175,7 @@ __u32 in_aton(const char *str)
                if (*str != '\0')
                {
                        val = 0;
-                       while (*str != '\0' && *str != '.')
+                       while (*str != '\0' && *str != '.' && *str != '\n')
                        {
                                val *= 10;
                                val += *str - '0';