Skip to content

Commit efa7416

Browse files
kaberDavid S. Miller
authored andcommitted
[NETFILTER]: x_tables: remove unused size argument to check/destroy functions
The size is verified by x_tables and isn't needed by the modules anymore. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fe1cb10 commit efa7416

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+26
-106
lines changed

include/linux/netfilter/x_tables.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,10 @@ struct xt_match
174174
const void *ip,
175175
const struct xt_match *match,
176176
void *matchinfo,
177-
unsigned int matchinfosize,
178177
unsigned int hook_mask);
179178

180179
/* Called when entry of this type deleted. */
181-
void (*destroy)(const struct xt_match *match, void *matchinfo,
182-
unsigned int matchinfosize);
180+
void (*destroy)(const struct xt_match *match, void *matchinfo);
183181

184182
/* Called when userspace align differs from kernel space one */
185183
int (*compat)(void *match, void **dstptr, int *size, int convert);
@@ -221,12 +219,10 @@ struct xt_target
221219
const void *entry,
222220
const struct xt_target *target,
223221
void *targinfo,
224-
unsigned int targinfosize,
225222
unsigned int hook_mask);
226223

227224
/* Called when entry of this type deleted. */
228-
void (*destroy)(const struct xt_target *target, void *targinfo,
229-
unsigned int targinfosize);
225+
void (*destroy)(const struct xt_target *target, void *targinfo);
230226

231227
/* Called when userspace align differs from kernel space one */
232228
int (*compat)(void *target, void **dstptr, int *size, int convert);

net/ipv4/netfilter/arp_tables.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,6 @@ static inline int check_entry(struct arpt_entry *e, const char *name, unsigned i
491491
}
492492
} else if (t->u.kernel.target->checkentry
493493
&& !t->u.kernel.target->checkentry(name, e, target, t->data,
494-
t->u.target_size
495-
- sizeof(*t),
496494
e->comefrom)) {
497495
duprintf("arp_tables: check failed for `%s'.\n",
498496
t->u.kernel.target->name);
@@ -559,8 +557,7 @@ static inline int cleanup_entry(struct arpt_entry *e, unsigned int *i)
559557

560558
t = arpt_get_target(e);
561559
if (t->u.kernel.target->destroy)
562-
t->u.kernel.target->destroy(t->u.kernel.target, t->data,
563-
t->u.target_size - sizeof(*t));
560+
t->u.kernel.target->destroy(t->u.kernel.target, t->data);
564561
module_put(t->u.kernel.target->me);
565562
return 0;
566563
}

net/ipv4/netfilter/arpt_mangle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ target(struct sk_buff **pskb,
6767

6868
static int
6969
checkentry(const char *tablename, const void *e, const struct xt_target *target,
70-
void *targinfo, unsigned int targinfosize, unsigned int hook_mask)
70+
void *targinfo, unsigned int hook_mask)
7171
{
7272
const struct arpt_mangle *mangle = targinfo;
7373

net/ipv4/netfilter/ip_nat_rule.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ static int ipt_snat_checkentry(const char *tablename,
172172
const void *entry,
173173
const struct ipt_target *target,
174174
void *targinfo,
175-
unsigned int targinfosize,
176175
unsigned int hook_mask)
177176
{
178177
struct ip_nat_multi_range_compat *mr = targinfo;
@@ -189,7 +188,6 @@ static int ipt_dnat_checkentry(const char *tablename,
189188
const void *entry,
190189
const struct ipt_target *target,
191190
void *targinfo,
192-
unsigned int targinfosize,
193191
unsigned int hook_mask)
194192
{
195193
struct ip_nat_multi_range_compat *mr = targinfo;

net/ipv4/netfilter/ip_tables.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,7 @@ cleanup_match(struct ipt_entry_match *m, unsigned int *i)
464464
return 1;
465465

466466
if (m->u.kernel.match->destroy)
467-
m->u.kernel.match->destroy(m->u.kernel.match, m->data,
468-
m->u.match_size - sizeof(*m));
467+
m->u.kernel.match->destroy(m->u.kernel.match, m->data);
469468
module_put(m->u.kernel.match->me);
470469
return 0;
471470
}
@@ -518,7 +517,6 @@ check_match(struct ipt_entry_match *m,
518517

519518
if (m->u.kernel.match->checkentry
520519
&& !m->u.kernel.match->checkentry(name, ip, match, m->data,
521-
m->u.match_size - sizeof(*m),
522520
hookmask)) {
523521
duprintf("ip_tables: check failed for `%s'.\n",
524522
m->u.kernel.match->name);
@@ -579,8 +577,6 @@ check_entry(struct ipt_entry *e, const char *name, unsigned int size,
579577
}
580578
} else if (t->u.kernel.target->checkentry
581579
&& !t->u.kernel.target->checkentry(name, e, target, t->data,
582-
t->u.target_size
583-
- sizeof(*t),
584580
e->comefrom)) {
585581
duprintf("ip_tables: check failed for `%s'.\n",
586582
t->u.kernel.target->name);
@@ -652,8 +648,7 @@ cleanup_entry(struct ipt_entry *e, unsigned int *i)
652648
IPT_MATCH_ITERATE(e, cleanup_match, NULL);
653649
t = ipt_get_target(e);
654650
if (t->u.kernel.target->destroy)
655-
t->u.kernel.target->destroy(t->u.kernel.target, t->data,
656-
t->u.target_size - sizeof(*t));
651+
t->u.kernel.target->destroy(t->u.kernel.target, t->data);
657652
module_put(t->u.kernel.target->me);
658653
return 0;
659654
}
@@ -1599,7 +1594,6 @@ static inline int compat_copy_match_from_user(struct ipt_entry_match *m,
15991594

16001595
if (m->u.kernel.match->checkentry
16011596
&& !m->u.kernel.match->checkentry(name, ip, match, dm->data,
1602-
dm->u.match_size - sizeof(*dm),
16031597
hookmask)) {
16041598
duprintf("ip_tables: check failed for `%s'.\n",
16051599
m->u.kernel.match->name);
@@ -1658,8 +1652,7 @@ static int compat_copy_entry_from_user(struct ipt_entry *e, void **dstptr,
16581652
goto out;
16591653
} else if (t->u.kernel.target->checkentry
16601654
&& !t->u.kernel.target->checkentry(name, de, target,
1661-
t->data, t->u.target_size - sizeof(*t),
1662-
de->comefrom)) {
1655+
t->data, de->comefrom)) {
16631656
duprintf("ip_tables: compat: check failed for `%s'.\n",
16641657
t->u.kernel.target->name);
16651658
goto out;
@@ -2182,7 +2175,6 @@ icmp_checkentry(const char *tablename,
21822175
const void *info,
21832176
const struct xt_match *match,
21842177
void *matchinfo,
2185-
unsigned int matchsize,
21862178
unsigned int hook_mask)
21872179
{
21882180
const struct ipt_icmp *icmpinfo = matchinfo;

net/ipv4/netfilter/ipt_CLUSTERIP.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,6 @@ checkentry(const char *tablename,
372372
const void *e_void,
373373
const struct xt_target *target,
374374
void *targinfo,
375-
unsigned int targinfosize,
376375
unsigned int hook_mask)
377376
{
378377
struct ipt_clusterip_tgt_info *cipinfo = targinfo;
@@ -449,8 +448,7 @@ checkentry(const char *tablename,
449448
}
450449

451450
/* drop reference count of cluster config when rule is deleted */
452-
static void destroy(const struct xt_target *target, void *targinfo,
453-
unsigned int targinfosize)
451+
static void destroy(const struct xt_target *target, void *targinfo)
454452
{
455453
struct ipt_clusterip_tgt_info *cipinfo = targinfo;
456454

net/ipv4/netfilter/ipt_ECN.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ checkentry(const char *tablename,
106106
const void *e_void,
107107
const struct xt_target *target,
108108
void *targinfo,
109-
unsigned int targinfosize,
110109
unsigned int hook_mask)
111110
{
112111
const struct ipt_ECN_info *einfo = (struct ipt_ECN_info *)targinfo;

net/ipv4/netfilter/ipt_LOG.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,6 @@ static int ipt_log_checkentry(const char *tablename,
439439
const void *e,
440440
const struct xt_target *target,
441441
void *targinfo,
442-
unsigned int targinfosize,
443442
unsigned int hook_mask)
444443
{
445444
const struct ipt_log_info *loginfo = targinfo;

net/ipv4/netfilter/ipt_MASQUERADE.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ masquerade_check(const char *tablename,
4242
const void *e,
4343
const struct xt_target *target,
4444
void *targinfo,
45-
unsigned int targinfosize,
4645
unsigned int hook_mask)
4746
{
4847
const struct ip_nat_multi_range_compat *mr = targinfo;

net/ipv4/netfilter/ipt_NETMAP.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ check(const char *tablename,
3333
const void *e,
3434
const struct xt_target *target,
3535
void *targinfo,
36-
unsigned int targinfosize,
3736
unsigned int hook_mask)
3837
{
3938
const struct ip_nat_multi_range_compat *mr = targinfo;

net/ipv4/netfilter/ipt_REDIRECT.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ redirect_check(const char *tablename,
3636
const void *e,
3737
const struct xt_target *target,
3838
void *targinfo,
39-
unsigned int targinfosize,
4039
unsigned int hook_mask)
4140
{
4241
const struct ip_nat_multi_range_compat *mr = targinfo;

net/ipv4/netfilter/ipt_REJECT.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ static int check(const char *tablename,
276276
const void *e_void,
277277
const struct xt_target *target,
278278
void *targinfo,
279-
unsigned int targinfosize,
280279
unsigned int hook_mask)
281280
{
282281
const struct ipt_reject_info *rejinfo = targinfo;

net/ipv4/netfilter/ipt_SAME.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ same_check(const char *tablename,
5252
const void *e,
5353
const struct xt_target *target,
5454
void *targinfo,
55-
unsigned int targinfosize,
5655
unsigned int hook_mask)
5756
{
5857
unsigned int count, countess, rangeip, index = 0;
@@ -116,8 +115,7 @@ same_check(const char *tablename,
116115
}
117116

118117
static void
119-
same_destroy(const struct xt_target *target, void *targinfo,
120-
unsigned int targinfosize)
118+
same_destroy(const struct xt_target *target, void *targinfo)
121119
{
122120
struct ipt_same_info *mr = targinfo;
123121

net/ipv4/netfilter/ipt_TCPMSS.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ ipt_tcpmss_checkentry(const char *tablename,
207207
const void *e_void,
208208
const struct xt_target *target,
209209
void *targinfo,
210-
unsigned int targinfosize,
211210
unsigned int hook_mask)
212211
{
213212
const struct ipt_tcpmss_info *tcpmssinfo = targinfo;

net/ipv4/netfilter/ipt_TOS.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ checkentry(const char *tablename,
4949
const void *e_void,
5050
const struct xt_target *target,
5151
void *targinfo,
52-
unsigned int targinfosize,
5352
unsigned int hook_mask)
5453
{
5554
const u_int8_t tos = ((struct ipt_tos_target_info *)targinfo)->tos;

net/ipv4/netfilter/ipt_TTL.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ static int ipt_ttl_checkentry(const char *tablename,
6767
const void *e,
6868
const struct xt_target *target,
6969
void *targinfo,
70-
unsigned int targinfosize,
7170
unsigned int hook_mask)
7271
{
7372
struct ipt_TTL_info *info = targinfo;

net/ipv4/netfilter/ipt_ULOG.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ static int ipt_ulog_checkentry(const char *tablename,
346346
const void *e,
347347
const struct xt_target *target,
348348
void *targinfo,
349-
unsigned int targinfosize,
350349
unsigned int hookmask)
351350
{
352351
struct ipt_ulog_info *loginfo = (struct ipt_ulog_info *) targinfo;

net/ipv4/netfilter/ipt_ah.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ checkentry(const char *tablename,
7474
const void *ip_void,
7575
const struct xt_match *match,
7676
void *matchinfo,
77-
unsigned int matchinfosize,
7877
unsigned int hook_mask)
7978
{
8079
const struct ipt_ah *ahinfo = matchinfo;

net/ipv4/netfilter/ipt_ecn.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ static int match(const struct sk_buff *skb,
8888

8989
static int checkentry(const char *tablename, const void *ip_void,
9090
const struct xt_match *match,
91-
void *matchinfo, unsigned int matchsize,
92-
unsigned int hook_mask)
91+
void *matchinfo, unsigned int hook_mask)
9392
{
9493
const struct ipt_ecn_info *info = matchinfo;
9594
const struct ipt_ip *ip = ip_void;

net/ipv4/netfilter/ipt_hashlimit.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,6 @@ hashlimit_checkentry(const char *tablename,
478478
const void *inf,
479479
const struct xt_match *match,
480480
void *matchinfo,
481-
unsigned int matchsize,
482481
unsigned int hook_mask)
483482
{
484483
struct ipt_hashlimit_info *r = matchinfo;
@@ -529,8 +528,7 @@ hashlimit_checkentry(const char *tablename,
529528
}
530529

531530
static void
532-
hashlimit_destroy(const struct xt_match *match, void *matchinfo,
533-
unsigned int matchsize)
531+
hashlimit_destroy(const struct xt_match *match, void *matchinfo)
534532
{
535533
struct ipt_hashlimit_info *r = matchinfo;
536534

net/ipv4/netfilter/ipt_owner.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ checkentry(const char *tablename,
5656
const void *ip,
5757
const struct xt_match *match,
5858
void *matchinfo,
59-
unsigned int matchsize,
6059
unsigned int hook_mask)
6160
{
6261
const struct ipt_owner_info *info = matchinfo;

net/ipv4/netfilter/ipt_recent.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ ipt_recent_match(const struct sk_buff *skb,
238238
static int
239239
ipt_recent_checkentry(const char *tablename, const void *ip,
240240
const struct xt_match *match, void *matchinfo,
241-
unsigned int matchsize, unsigned int hook_mask)
241+
unsigned int hook_mask)
242242
{
243243
const struct ipt_recent_info *info = matchinfo;
244244
struct recent_table *t;
@@ -294,8 +294,7 @@ ipt_recent_checkentry(const char *tablename, const void *ip,
294294
}
295295

296296
static void
297-
ipt_recent_destroy(const struct xt_match *match, void *matchinfo,
298-
unsigned int matchsize)
297+
ipt_recent_destroy(const struct xt_match *match, void *matchinfo)
299298
{
300299
const struct ipt_recent_info *info = matchinfo;
301300
struct recent_table *t;

net/ipv6/netfilter/ip6_tables.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,7 @@ cleanup_match(struct ip6t_entry_match *m, unsigned int *i)
504504
return 1;
505505

506506
if (m->u.kernel.match->destroy)
507-
m->u.kernel.match->destroy(m->u.kernel.match, m->data,
508-
m->u.match_size - sizeof(*m));
507+
m->u.kernel.match->destroy(m->u.kernel.match, m->data);
509508
module_put(m->u.kernel.match->me);
510509
return 0;
511510
}
@@ -558,7 +557,6 @@ check_match(struct ip6t_entry_match *m,
558557

559558
if (m->u.kernel.match->checkentry
560559
&& !m->u.kernel.match->checkentry(name, ipv6, match, m->data,
561-
m->u.match_size - sizeof(*m),
562560
hookmask)) {
563561
duprintf("ip_tables: check failed for `%s'.\n",
564562
m->u.kernel.match->name);
@@ -619,8 +617,6 @@ check_entry(struct ip6t_entry *e, const char *name, unsigned int size,
619617
}
620618
} else if (t->u.kernel.target->checkentry
621619
&& !t->u.kernel.target->checkentry(name, e, target, t->data,
622-
t->u.target_size
623-
- sizeof(*t),
624620
e->comefrom)) {
625621
duprintf("ip_tables: check failed for `%s'.\n",
626622
t->u.kernel.target->name);
@@ -692,8 +688,7 @@ cleanup_entry(struct ip6t_entry *e, unsigned int *i)
692688
IP6T_MATCH_ITERATE(e, cleanup_match, NULL);
693689
t = ip6t_get_target(e);
694690
if (t->u.kernel.target->destroy)
695-
t->u.kernel.target->destroy(t->u.kernel.target, t->data,
696-
t->u.target_size - sizeof(*t));
691+
t->u.kernel.target->destroy(t->u.kernel.target, t->data);
697692
module_put(t->u.kernel.target->me);
698693
return 0;
699694
}
@@ -1349,7 +1344,6 @@ icmp6_checkentry(const char *tablename,
13491344
const void *entry,
13501345
const struct xt_match *match,
13511346
void *matchinfo,
1352-
unsigned int matchsize,
13531347
unsigned int hook_mask)
13541348
{
13551349
const struct ip6t_icmp *icmpinfo = matchinfo;

net/ipv6/netfilter/ip6t_HL.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ static int ip6t_hl_checkentry(const char *tablename,
6666
const void *entry,
6767
const struct xt_target *target,
6868
void *targinfo,
69-
unsigned int targinfosize,
7069
unsigned int hook_mask)
7170
{
7271
struct ip6t_HL_info *info = targinfo;

net/ipv6/netfilter/ip6t_LOG.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ static int ip6t_log_checkentry(const char *tablename,
451451
const void *entry,
452452
const struct xt_target *target,
453453
void *targinfo,
454-
unsigned int targinfosize,
455454
unsigned int hook_mask)
456455
{
457456
const struct ip6t_log_info *loginfo = targinfo;

net/ipv6/netfilter/ip6t_REJECT.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ static int check(const char *tablename,
223223
const void *entry,
224224
const struct xt_target *target,
225225
void *targinfo,
226-
unsigned int targinfosize,
227226
unsigned int hook_mask)
228227
{
229228
const struct ip6t_reject_info *rejinfo = targinfo;

net/ipv6/netfilter/ip6t_ah.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ checkentry(const char *tablename,
102102
const void *entry,
103103
const struct xt_match *match,
104104
void *matchinfo,
105-
unsigned int matchinfosize,
106105
unsigned int hook_mask)
107106
{
108107
const struct ip6t_ah *ahinfo = matchinfo;

net/ipv6/netfilter/ip6t_dst.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ checkentry(const char *tablename,
182182
const void *info,
183183
const struct xt_match *match,
184184
void *matchinfo,
185-
unsigned int matchinfosize,
186185
unsigned int hook_mask)
187186
{
188187
const struct ip6t_opts *optsinfo = matchinfo;

0 commit comments

Comments
 (0)