diff options
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/neighbour.c | 3 | ||||
-rw-r--r-- | net/core/sysctl_net_core.c | 15 |
2 files changed, 2 insertions, 16 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index f6bdcad47da6..851eb927ed97 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <net/sock.h> | 32 | #include <net/sock.h> |
33 | #include <linux/rtnetlink.h> | 33 | #include <linux/rtnetlink.h> |
34 | #include <linux/random.h> | 34 | #include <linux/random.h> |
35 | #include <linux/string.h> | ||
35 | 36 | ||
36 | #define NEIGH_DEBUG 1 | 37 | #define NEIGH_DEBUG 1 |
37 | 38 | ||
@@ -2592,7 +2593,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, | |||
2592 | t->neigh_vars[17].extra1 = dev; | 2593 | t->neigh_vars[17].extra1 = dev; |
2593 | } | 2594 | } |
2594 | 2595 | ||
2595 | dev_name = net_sysctl_strdup(dev_name_source); | 2596 | dev_name = kstrdup(dev_name_source, GFP_KERNEL); |
2596 | if (!dev_name) { | 2597 | if (!dev_name) { |
2597 | err = -ENOBUFS; | 2598 | err = -ENOBUFS; |
2598 | goto free; | 2599 | goto free; |
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index c8be646cb191..880a88815211 100644 --- a/net/core/sysctl_net_core.c +++ b/net/core/sysctl_net_core.c | |||
@@ -35,19 +35,6 @@ extern int sysctl_somaxconn; | |||
35 | extern char sysctl_divert_version[]; | 35 | extern char sysctl_divert_version[]; |
36 | #endif /* CONFIG_NET_DIVERT */ | 36 | #endif /* CONFIG_NET_DIVERT */ |
37 | 37 | ||
38 | /* | ||
39 | * This strdup() is used for creating copies of network | ||
40 | * device names to be handed over to sysctl. | ||
41 | */ | ||
42 | |||
43 | char *net_sysctl_strdup(const char *s) | ||
44 | { | ||
45 | char *rv = kmalloc(strlen(s)+1, GFP_KERNEL); | ||
46 | if (rv) | ||
47 | strcpy(rv, s); | ||
48 | return rv; | ||
49 | } | ||
50 | |||
51 | ctl_table core_table[] = { | 38 | ctl_table core_table[] = { |
52 | #ifdef CONFIG_NET | 39 | #ifdef CONFIG_NET |
53 | { | 40 | { |
@@ -177,6 +164,4 @@ ctl_table core_table[] = { | |||
177 | { .ctl_name = 0 } | 164 | { .ctl_name = 0 } |
178 | }; | 165 | }; |
179 | 166 | ||
180 | EXPORT_SYMBOL(net_sysctl_strdup); | ||
181 | |||
182 | #endif | 167 | #endif |