aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/netfilter_arp/arp_tables.h10
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h10
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h11
-rw-r--r--net/ipv4/netfilter/arp_tables.c10
-rw-r--r--net/ipv4/netfilter/ip_tables.c12
-rw-r--r--net/ipv6/netfilter/ip6_tables.c12
6 files changed, 35 insertions, 30 deletions
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index e9948c0560f6..81938600470d 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -21,8 +21,10 @@
21 21
22#include <linux/netfilter/x_tables.h> 22#include <linux/netfilter/x_tables.h>
23 23
24#ifndef __KERNEL__
24#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN 25#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
25#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN 26#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
27#endif
26 28
27#define ARPT_DEV_ADDR_LEN_MAX 16 29#define ARPT_DEV_ADDR_LEN_MAX 16
28 30
@@ -134,7 +136,7 @@ struct arpt_entry
134/* The argument to ARPT_SO_GET_INFO */ 136/* The argument to ARPT_SO_GET_INFO */
135struct arpt_getinfo { 137struct arpt_getinfo {
136 /* Which table: caller fills this in. */ 138 /* Which table: caller fills this in. */
137 char name[ARPT_TABLE_MAXNAMELEN]; 139 char name[XT_TABLE_MAXNAMELEN];
138 140
139 /* Kernel fills these in. */ 141 /* Kernel fills these in. */
140 /* Which hook entry points are valid: bitmask */ 142 /* Which hook entry points are valid: bitmask */
@@ -156,7 +158,7 @@ struct arpt_getinfo {
156/* The argument to ARPT_SO_SET_REPLACE. */ 158/* The argument to ARPT_SO_SET_REPLACE. */
157struct arpt_replace { 159struct arpt_replace {
158 /* Which table. */ 160 /* Which table. */
159 char name[ARPT_TABLE_MAXNAMELEN]; 161 char name[XT_TABLE_MAXNAMELEN];
160 162
161 /* Which hook entry points are valid: bitmask. You can't 163 /* Which hook entry points are valid: bitmask. You can't
162 change this. */ 164 change this. */
@@ -191,7 +193,7 @@ struct arpt_replace {
191/* The argument to ARPT_SO_GET_ENTRIES. */ 193/* The argument to ARPT_SO_GET_ENTRIES. */
192struct arpt_get_entries { 194struct arpt_get_entries {
193 /* Which table: user fills this in. */ 195 /* Which table: user fills this in. */
194 char name[ARPT_TABLE_MAXNAMELEN]; 196 char name[XT_TABLE_MAXNAMELEN];
195 197
196 /* User fills this in: total entry size. */ 198 /* User fills this in: total entry size. */
197 unsigned int size; 199 unsigned int size;
@@ -230,7 +232,7 @@ struct arpt_standard {
230 232
231struct arpt_error_target { 233struct arpt_error_target {
232 struct arpt_entry_target target; 234 struct arpt_entry_target target;
233 char errorname[ARPT_FUNCTION_MAXNAMELEN]; 235 char errorname[XT_FUNCTION_MAXNAMELEN];
234}; 236};
235 237
236struct arpt_error { 238struct arpt_error {
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 704a7b6e8169..1b7cdf1137e3 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -27,12 +27,14 @@
27 27
28#include <linux/netfilter/x_tables.h> 28#include <linux/netfilter/x_tables.h>
29 29
30#ifndef __KERNEL__
30#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN 31#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
31#define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN 32#define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
32#define ipt_match xt_match 33#define ipt_match xt_match
33#define ipt_target xt_target 34#define ipt_target xt_target
34#define ipt_table xt_table 35#define ipt_table xt_table
35#define ipt_get_revision xt_get_revision 36#define ipt_get_revision xt_get_revision
37#endif
36 38
37/* Yes, Virginia, you have to zero the padding. */ 39/* Yes, Virginia, you have to zero the padding. */
38struct ipt_ip { 40struct ipt_ip {
@@ -146,7 +148,7 @@ struct ipt_icmp {
146/* The argument to IPT_SO_GET_INFO */ 148/* The argument to IPT_SO_GET_INFO */
147struct ipt_getinfo { 149struct ipt_getinfo {
148 /* Which table: caller fills this in. */ 150 /* Which table: caller fills this in. */
149 char name[IPT_TABLE_MAXNAMELEN]; 151 char name[XT_TABLE_MAXNAMELEN];
150 152
151 /* Kernel fills these in. */ 153 /* Kernel fills these in. */
152 /* Which hook entry points are valid: bitmask */ 154 /* Which hook entry points are valid: bitmask */
@@ -168,7 +170,7 @@ struct ipt_getinfo {
168/* The argument to IPT_SO_SET_REPLACE. */ 170/* The argument to IPT_SO_SET_REPLACE. */
169struct ipt_replace { 171struct ipt_replace {
170 /* Which table. */ 172 /* Which table. */
171 char name[IPT_TABLE_MAXNAMELEN]; 173 char name[XT_TABLE_MAXNAMELEN];
172 174
173 /* Which hook entry points are valid: bitmask. You can't 175 /* Which hook entry points are valid: bitmask. You can't
174 change this. */ 176 change this. */
@@ -202,7 +204,7 @@ struct ipt_replace {
202/* The argument to IPT_SO_GET_ENTRIES. */ 204/* The argument to IPT_SO_GET_ENTRIES. */
203struct ipt_get_entries { 205struct ipt_get_entries {
204 /* Which table: user fills this in. */ 206 /* Which table: user fills this in. */
205 char name[IPT_TABLE_MAXNAMELEN]; 207 char name[XT_TABLE_MAXNAMELEN];
206 208
207 /* User fills this in: total entry size. */ 209 /* User fills this in: total entry size. */
208 unsigned int size; 210 unsigned int size;
@@ -254,7 +256,7 @@ struct ipt_standard {
254 256
255struct ipt_error_target { 257struct ipt_error_target {
256 struct ipt_entry_target target; 258 struct ipt_entry_target target;
257 char errorname[IPT_FUNCTION_MAXNAMELEN]; 259 char errorname[XT_FUNCTION_MAXNAMELEN];
258}; 260};
259 261
260struct ipt_error { 262struct ipt_error {
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 18442ff19c07..abe31d020e3c 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -27,13 +27,14 @@
27 27
28#include <linux/netfilter/x_tables.h> 28#include <linux/netfilter/x_tables.h>
29 29
30#ifndef __KERNEL__
30#define IP6T_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN 31#define IP6T_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
31#define IP6T_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN 32#define IP6T_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
32
33#define ip6t_match xt_match 33#define ip6t_match xt_match
34#define ip6t_target xt_target 34#define ip6t_target xt_target
35#define ip6t_table xt_table 35#define ip6t_table xt_table
36#define ip6t_get_revision xt_get_revision 36#define ip6t_get_revision xt_get_revision
37#endif
37 38
38/* Yes, Virginia, you have to zero the padding. */ 39/* Yes, Virginia, you have to zero the padding. */
39struct ip6t_ip6 { 40struct ip6t_ip6 {
@@ -117,7 +118,7 @@ struct ip6t_standard {
117 118
118struct ip6t_error_target { 119struct ip6t_error_target {
119 struct ip6t_entry_target target; 120 struct ip6t_entry_target target;
120 char errorname[IP6T_FUNCTION_MAXNAMELEN]; 121 char errorname[XT_FUNCTION_MAXNAMELEN];
121}; 122};
122 123
123struct ip6t_error { 124struct ip6t_error {
@@ -203,7 +204,7 @@ struct ip6t_icmp {
203/* The argument to IP6T_SO_GET_INFO */ 204/* The argument to IP6T_SO_GET_INFO */
204struct ip6t_getinfo { 205struct ip6t_getinfo {
205 /* Which table: caller fills this in. */ 206 /* Which table: caller fills this in. */
206 char name[IP6T_TABLE_MAXNAMELEN]; 207 char name[XT_TABLE_MAXNAMELEN];
207 208
208 /* Kernel fills these in. */ 209 /* Kernel fills these in. */
209 /* Which hook entry points are valid: bitmask */ 210 /* Which hook entry points are valid: bitmask */
@@ -225,7 +226,7 @@ struct ip6t_getinfo {
225/* The argument to IP6T_SO_SET_REPLACE. */ 226/* The argument to IP6T_SO_SET_REPLACE. */
226struct ip6t_replace { 227struct ip6t_replace {
227 /* Which table. */ 228 /* Which table. */
228 char name[IP6T_TABLE_MAXNAMELEN]; 229 char name[XT_TABLE_MAXNAMELEN];
229 230
230 /* Which hook entry points are valid: bitmask. You can't 231 /* Which hook entry points are valid: bitmask. You can't
231 change this. */ 232 change this. */
@@ -259,7 +260,7 @@ struct ip6t_replace {
259/* The argument to IP6T_SO_GET_ENTRIES. */ 260/* The argument to IP6T_SO_GET_ENTRIES. */
260struct ip6t_get_entries { 261struct ip6t_get_entries {
261 /* Which table: user fills this in. */ 262 /* Which table: user fills this in. */
262 char name[IP6T_TABLE_MAXNAMELEN]; 263 char name[XT_TABLE_MAXNAMELEN];
263 264
264 /* User fills this in: total entry size. */ 265 /* User fills this in: total entry size. */
265 unsigned int size; 266 unsigned int size;
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index e8f4f9a57f12..e427a9e3c489 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -895,7 +895,7 @@ static int compat_table_info(const struct xt_table_info *info,
895static int get_info(struct net *net, void __user *user, 895static int get_info(struct net *net, void __user *user,
896 const int *len, int compat) 896 const int *len, int compat)
897{ 897{
898 char name[ARPT_TABLE_MAXNAMELEN]; 898 char name[XT_TABLE_MAXNAMELEN];
899 struct xt_table *t; 899 struct xt_table *t;
900 int ret; 900 int ret;
901 901
@@ -908,7 +908,7 @@ static int get_info(struct net *net, void __user *user,
908 if (copy_from_user(name, user, sizeof(name)) != 0) 908 if (copy_from_user(name, user, sizeof(name)) != 0)
909 return -EFAULT; 909 return -EFAULT;
910 910
911 name[ARPT_TABLE_MAXNAMELEN-1] = '\0'; 911 name[XT_TABLE_MAXNAMELEN-1] = '\0';
912#ifdef CONFIG_COMPAT 912#ifdef CONFIG_COMPAT
913 if (compat) 913 if (compat)
914 xt_compat_lock(NFPROTO_ARP); 914 xt_compat_lock(NFPROTO_ARP);
@@ -1474,7 +1474,7 @@ out_unlock:
1474} 1474}
1475 1475
1476struct compat_arpt_replace { 1476struct compat_arpt_replace {
1477 char name[ARPT_TABLE_MAXNAMELEN]; 1477 char name[XT_TABLE_MAXNAMELEN];
1478 u32 valid_hooks; 1478 u32 valid_hooks;
1479 u32 num_entries; 1479 u32 num_entries;
1480 u32 size; 1480 u32 size;
@@ -1628,7 +1628,7 @@ static int compat_copy_entries_to_user(unsigned int total_size,
1628} 1628}
1629 1629
1630struct compat_arpt_get_entries { 1630struct compat_arpt_get_entries {
1631 char name[ARPT_TABLE_MAXNAMELEN]; 1631 char name[XT_TABLE_MAXNAMELEN];
1632 compat_uint_t size; 1632 compat_uint_t size;
1633 struct compat_arpt_entry entrytable[0]; 1633 struct compat_arpt_entry entrytable[0];
1634}; 1634};
@@ -1840,7 +1840,7 @@ static struct xt_target arpt_builtin_tg[] __read_mostly = {
1840 { 1840 {
1841 .name = ARPT_ERROR_TARGET, 1841 .name = ARPT_ERROR_TARGET,
1842 .target = arpt_error, 1842 .target = arpt_error,
1843 .targetsize = ARPT_FUNCTION_MAXNAMELEN, 1843 .targetsize = XT_FUNCTION_MAXNAMELEN,
1844 .family = NFPROTO_ARP, 1844 .family = NFPROTO_ARP,
1845 }, 1845 },
1846}; 1846};
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index d163f2e3b2e9..2efd41bef452 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -1092,7 +1092,7 @@ static int compat_table_info(const struct xt_table_info *info,
1092static int get_info(struct net *net, void __user *user, 1092static int get_info(struct net *net, void __user *user,
1093 const int *len, int compat) 1093 const int *len, int compat)
1094{ 1094{
1095 char name[IPT_TABLE_MAXNAMELEN]; 1095 char name[XT_TABLE_MAXNAMELEN];
1096 struct xt_table *t; 1096 struct xt_table *t;
1097 int ret; 1097 int ret;
1098 1098
@@ -1105,7 +1105,7 @@ static int get_info(struct net *net, void __user *user,
1105 if (copy_from_user(name, user, sizeof(name)) != 0) 1105 if (copy_from_user(name, user, sizeof(name)) != 0)
1106 return -EFAULT; 1106 return -EFAULT;
1107 1107
1108 name[IPT_TABLE_MAXNAMELEN-1] = '\0'; 1108 name[XT_TABLE_MAXNAMELEN-1] = '\0';
1109#ifdef CONFIG_COMPAT 1109#ifdef CONFIG_COMPAT
1110 if (compat) 1110 if (compat)
1111 xt_compat_lock(AF_INET); 1111 xt_compat_lock(AF_INET);
@@ -1400,7 +1400,7 @@ do_add_counters(struct net *net, const void __user *user,
1400 1400
1401#ifdef CONFIG_COMPAT 1401#ifdef CONFIG_COMPAT
1402struct compat_ipt_replace { 1402struct compat_ipt_replace {
1403 char name[IPT_TABLE_MAXNAMELEN]; 1403 char name[XT_TABLE_MAXNAMELEN];
1404 u32 valid_hooks; 1404 u32 valid_hooks;
1405 u32 num_entries; 1405 u32 num_entries;
1406 u32 size; 1406 u32 size;
@@ -1884,7 +1884,7 @@ compat_do_ipt_set_ctl(struct sock *sk, int cmd, void __user *user,
1884} 1884}
1885 1885
1886struct compat_ipt_get_entries { 1886struct compat_ipt_get_entries {
1887 char name[IPT_TABLE_MAXNAMELEN]; 1887 char name[XT_TABLE_MAXNAMELEN];
1888 compat_uint_t size; 1888 compat_uint_t size;
1889 struct compat_ipt_entry entrytable[0]; 1889 struct compat_ipt_entry entrytable[0];
1890}; 1890};
@@ -2039,7 +2039,7 @@ do_ipt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
2039 2039
2040 case IPT_SO_GET_REVISION_MATCH: 2040 case IPT_SO_GET_REVISION_MATCH:
2041 case IPT_SO_GET_REVISION_TARGET: { 2041 case IPT_SO_GET_REVISION_TARGET: {
2042 struct ipt_get_revision rev; 2042 struct xt_get_revision rev;
2043 int target; 2043 int target;
2044 2044
2045 if (*len != sizeof(rev)) { 2045 if (*len != sizeof(rev)) {
@@ -2188,7 +2188,7 @@ static struct xt_target ipt_builtin_tg[] __read_mostly = {
2188 { 2188 {
2189 .name = IPT_ERROR_TARGET, 2189 .name = IPT_ERROR_TARGET,
2190 .target = ipt_error, 2190 .target = ipt_error,
2191 .targetsize = IPT_FUNCTION_MAXNAMELEN, 2191 .targetsize = XT_FUNCTION_MAXNAMELEN,
2192 .family = NFPROTO_IPV4, 2192 .family = NFPROTO_IPV4,
2193 }, 2193 },
2194}; 2194};
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index 8e754be92c24..4b973e13952d 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -1105,7 +1105,7 @@ static int compat_table_info(const struct xt_table_info *info,
1105static int get_info(struct net *net, void __user *user, 1105static int get_info(struct net *net, void __user *user,
1106 const int *len, int compat) 1106 const int *len, int compat)
1107{ 1107{
1108 char name[IP6T_TABLE_MAXNAMELEN]; 1108 char name[XT_TABLE_MAXNAMELEN];
1109 struct xt_table *t; 1109 struct xt_table *t;
1110 int ret; 1110 int ret;
1111 1111
@@ -1118,7 +1118,7 @@ static int get_info(struct net *net, void __user *user,
1118 if (copy_from_user(name, user, sizeof(name)) != 0) 1118 if (copy_from_user(name, user, sizeof(name)) != 0)
1119 return -EFAULT; 1119 return -EFAULT;
1120 1120
1121 name[IP6T_TABLE_MAXNAMELEN-1] = '\0'; 1121 name[XT_TABLE_MAXNAMELEN-1] = '\0';
1122#ifdef CONFIG_COMPAT 1122#ifdef CONFIG_COMPAT
1123 if (compat) 1123 if (compat)
1124 xt_compat_lock(AF_INET6); 1124 xt_compat_lock(AF_INET6);
@@ -1415,7 +1415,7 @@ do_add_counters(struct net *net, const void __user *user, unsigned int len,
1415 1415
1416#ifdef CONFIG_COMPAT 1416#ifdef CONFIG_COMPAT
1417struct compat_ip6t_replace { 1417struct compat_ip6t_replace {
1418 char name[IP6T_TABLE_MAXNAMELEN]; 1418 char name[XT_TABLE_MAXNAMELEN];
1419 u32 valid_hooks; 1419 u32 valid_hooks;
1420 u32 num_entries; 1420 u32 num_entries;
1421 u32 size; 1421 u32 size;
@@ -1899,7 +1899,7 @@ compat_do_ip6t_set_ctl(struct sock *sk, int cmd, void __user *user,
1899} 1899}
1900 1900
1901struct compat_ip6t_get_entries { 1901struct compat_ip6t_get_entries {
1902 char name[IP6T_TABLE_MAXNAMELEN]; 1902 char name[XT_TABLE_MAXNAMELEN];
1903 compat_uint_t size; 1903 compat_uint_t size;
1904 struct compat_ip6t_entry entrytable[0]; 1904 struct compat_ip6t_entry entrytable[0];
1905}; 1905};
@@ -2054,7 +2054,7 @@ do_ip6t_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
2054 2054
2055 case IP6T_SO_GET_REVISION_MATCH: 2055 case IP6T_SO_GET_REVISION_MATCH:
2056 case IP6T_SO_GET_REVISION_TARGET: { 2056 case IP6T_SO_GET_REVISION_TARGET: {
2057 struct ip6t_get_revision rev; 2057 struct xt_get_revision rev;
2058 int target; 2058 int target;
2059 2059
2060 if (*len != sizeof(rev)) { 2060 if (*len != sizeof(rev)) {
@@ -2203,7 +2203,7 @@ static struct xt_target ip6t_builtin_tg[] __read_mostly = {
2203 { 2203 {
2204 .name = IP6T_ERROR_TARGET, 2204 .name = IP6T_ERROR_TARGET,
2205 .target = ip6t_error, 2205 .target = ip6t_error,
2206 .targetsize = IP6T_FUNCTION_MAXNAMELEN, 2206 .targetsize = XT_FUNCTION_MAXNAMELEN,
2207 .family = NFPROTO_IPV6, 2207 .family = NFPROTO_IPV6,
2208 }, 2208 },
2209}; 2209};