diff options
Diffstat (limited to 'kernel/sysctl_binary.c')
| -rw-r--r-- | kernel/sysctl_binary.c | 10 | 
1 files changed, 3 insertions, 7 deletions
| diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c index 59030570f5ca..1357c5786064 100644 --- a/kernel/sysctl_binary.c +++ b/kernel/sysctl_binary.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/file.h> | 13 | #include <linux/file.h> | 
| 14 | #include <linux/ctype.h> | 14 | #include <linux/ctype.h> | 
| 15 | #include <linux/netdevice.h> | 15 | #include <linux/netdevice.h> | 
| 16 | #include <linux/kernel.h> | ||
| 16 | #include <linux/slab.h> | 17 | #include <linux/slab.h> | 
| 17 | 18 | ||
| 18 | #ifdef CONFIG_SYSCTL_SYSCALL | 19 | #ifdef CONFIG_SYSCTL_SYSCALL | 
| @@ -224,7 +225,6 @@ static const struct bin_table bin_net_ipv4_route_table[] = { | |||
| 224 | { CTL_INT, NET_IPV4_ROUTE_MTU_EXPIRES, "mtu_expires" }, | 225 | { CTL_INT, NET_IPV4_ROUTE_MTU_EXPIRES, "mtu_expires" }, | 
| 225 | { CTL_INT, NET_IPV4_ROUTE_MIN_PMTU, "min_pmtu" }, | 226 | { CTL_INT, NET_IPV4_ROUTE_MIN_PMTU, "min_pmtu" }, | 
| 226 | { CTL_INT, NET_IPV4_ROUTE_MIN_ADVMSS, "min_adv_mss" }, | 227 | { CTL_INT, NET_IPV4_ROUTE_MIN_ADVMSS, "min_adv_mss" }, | 
| 227 | { CTL_INT, NET_IPV4_ROUTE_SECRET_INTERVAL, "secret_interval" }, | ||
| 228 | {} | 228 | {} | 
| 229 | }; | 229 | }; | 
| 230 | 230 | ||
| @@ -1125,11 +1125,6 @@ out: | |||
| 1125 | return result; | 1125 | return result; | 
| 1126 | } | 1126 | } | 
| 1127 | 1127 | ||
| 1128 | static unsigned hex_value(int ch) | ||
| 1129 | { | ||
| 1130 | return isdigit(ch) ? ch - '0' : ((ch | 0x20) - 'a') + 10; | ||
| 1131 | } | ||
| 1132 | |||
| 1133 | static ssize_t bin_uuid(struct file *file, | 1128 | static ssize_t bin_uuid(struct file *file, | 
| 1134 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | 1129 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | 
| 1135 | { | 1130 | { | 
| @@ -1157,7 +1152,8 @@ static ssize_t bin_uuid(struct file *file, | |||
| 1157 | if (!isxdigit(str[0]) || !isxdigit(str[1])) | 1152 | if (!isxdigit(str[0]) || !isxdigit(str[1])) | 
| 1158 | goto out; | 1153 | goto out; | 
| 1159 | 1154 | ||
| 1160 | uuid[i] = (hex_value(str[0]) << 4) | hex_value(str[1]); | 1155 | uuid[i] = (hex_to_bin(str[0]) << 4) | | 
| 1156 | hex_to_bin(str[1]); | ||
| 1161 | str += 2; | 1157 | str += 2; | 
| 1162 | if (*str == '-') | 1158 | if (*str == '-') | 
| 1163 | str++; | 1159 | str++; | 
