diff options
| -rw-r--r-- | include/linux/netfilter_arp/arp_tables.h | 15 | ||||
| -rw-r--r-- | include/linux/netfilter_ipv4/ip_tables.h | 18 | ||||
| -rw-r--r-- | include/linux/netfilter_ipv6/ip6_tables.h | 20 | ||||
| -rw-r--r-- | net/ipv4/netfilter/arp_tables.c | 38 | ||||
| -rw-r--r-- | net/ipv4/netfilter/ip_tables.c | 54 | ||||
| -rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 54 | ||||
| -rw-r--r-- | net/sched/act_ipt.c | 12 |
7 files changed, 103 insertions, 108 deletions
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index 81938600470d..7e193c9241b3 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h | |||
| @@ -24,6 +24,8 @@ | |||
| 24 | #ifndef __KERNEL__ | 24 | #ifndef __KERNEL__ |
| 25 | #define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN | 25 | #define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN |
| 26 | #define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN | 26 | #define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN |
| 27 | #define arpt_entry_target xt_entry_target | ||
| 28 | #define arpt_standard_target xt_standard_target | ||
| 27 | #endif | 29 | #endif |
| 28 | 30 | ||
| 29 | #define ARPT_DEV_ADDR_LEN_MAX 16 | 31 | #define ARPT_DEV_ADDR_LEN_MAX 16 |
| @@ -65,9 +67,6 @@ struct arpt_arp { | |||
| 65 | u_int16_t invflags; | 67 | u_int16_t invflags; |
| 66 | }; | 68 | }; |
| 67 | 69 | ||
| 68 | #define arpt_entry_target xt_entry_target | ||
| 69 | #define arpt_standard_target xt_standard_target | ||
| 70 | |||
| 71 | /* Values for "flag" field in struct arpt_ip (general arp structure). | 70 | /* Values for "flag" field in struct arpt_ip (general arp structure). |
| 72 | * No flags defined yet. | 71 | * No flags defined yet. |
| 73 | */ | 72 | */ |
| @@ -208,7 +207,7 @@ struct arpt_get_entries { | |||
| 208 | #define ARPT_ERROR_TARGET XT_ERROR_TARGET | 207 | #define ARPT_ERROR_TARGET XT_ERROR_TARGET |
| 209 | 208 | ||
| 210 | /* Helper functions */ | 209 | /* Helper functions */ |
| 211 | static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e) | 210 | static __inline__ struct xt_entry_target *arpt_get_target(struct arpt_entry *e) |
| 212 | { | 211 | { |
| 213 | return (void *)e + e->target_offset; | 212 | return (void *)e + e->target_offset; |
| 214 | } | 213 | } |
| @@ -227,11 +226,11 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e | |||
| 227 | /* Standard entry. */ | 226 | /* Standard entry. */ |
| 228 | struct arpt_standard { | 227 | struct arpt_standard { |
| 229 | struct arpt_entry entry; | 228 | struct arpt_entry entry; |
| 230 | struct arpt_standard_target target; | 229 | struct xt_standard_target target; |
| 231 | }; | 230 | }; |
| 232 | 231 | ||
| 233 | struct arpt_error_target { | 232 | struct arpt_error_target { |
| 234 | struct arpt_entry_target target; | 233 | struct xt_entry_target target; |
| 235 | char errorname[XT_FUNCTION_MAXNAMELEN]; | 234 | char errorname[XT_FUNCTION_MAXNAMELEN]; |
| 236 | }; | 235 | }; |
| 237 | 236 | ||
| @@ -250,7 +249,7 @@ struct arpt_error { | |||
| 250 | { \ | 249 | { \ |
| 251 | .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_standard)), \ | 250 | .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_standard)), \ |
| 252 | .target = XT_TARGET_INIT(ARPT_STANDARD_TARGET, \ | 251 | .target = XT_TARGET_INIT(ARPT_STANDARD_TARGET, \ |
| 253 | sizeof(struct arpt_standard_target)), \ | 252 | sizeof(struct xt_standard_target)), \ |
| 254 | .target.verdict = -(__verdict) - 1, \ | 253 | .target.verdict = -(__verdict) - 1, \ |
| 255 | } | 254 | } |
| 256 | 255 | ||
| @@ -287,7 +286,7 @@ struct compat_arpt_entry { | |||
| 287 | unsigned char elems[0]; | 286 | unsigned char elems[0]; |
| 288 | }; | 287 | }; |
| 289 | 288 | ||
| 290 | static inline struct arpt_entry_target * | 289 | static inline struct xt_entry_target * |
| 291 | compat_arpt_get_target(struct compat_arpt_entry *e) | 290 | compat_arpt_get_target(struct compat_arpt_entry *e) |
| 292 | { | 291 | { |
| 293 | return (void *)e + e->target_offset; | 292 | return (void *)e + e->target_offset; |
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 1b7cdf1137e3..ec506918a9b9 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
| @@ -34,6 +34,10 @@ | |||
| 34 | #define ipt_target xt_target | 34 | #define ipt_target xt_target |
| 35 | #define ipt_table xt_table | 35 | #define ipt_table xt_table |
| 36 | #define ipt_get_revision xt_get_revision | 36 | #define ipt_get_revision xt_get_revision |
| 37 | #define ipt_entry_match xt_entry_match | ||
| 38 | #define ipt_entry_target xt_entry_target | ||
| 39 | #define ipt_standard_target xt_standard_target | ||
| 40 | #define ipt_counters xt_counters | ||
| 37 | #endif | 41 | #endif |
| 38 | 42 | ||
| 39 | /* Yes, Virginia, you have to zero the padding. */ | 43 | /* Yes, Virginia, you have to zero the padding. */ |
| @@ -54,12 +58,6 @@ struct ipt_ip { | |||
| 54 | u_int8_t invflags; | 58 | u_int8_t invflags; |
| 55 | }; | 59 | }; |
| 56 | 60 | ||
| 57 | #define ipt_entry_match xt_entry_match | ||
| 58 | #define ipt_entry_target xt_entry_target | ||
| 59 | #define ipt_standard_target xt_standard_target | ||
| 60 | |||
| 61 | #define ipt_counters xt_counters | ||
| 62 | |||
| 63 | /* Values for "flag" field in struct ipt_ip (general ip structure). */ | 61 | /* Values for "flag" field in struct ipt_ip (general ip structure). */ |
| 64 | #define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */ | 62 | #define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */ |
| 65 | #define IPT_F_GOTO 0x02 /* Set if jump is a goto */ | 63 | #define IPT_F_GOTO 0x02 /* Set if jump is a goto */ |
| @@ -219,7 +217,7 @@ struct ipt_get_entries { | |||
| 219 | #define IPT_ERROR_TARGET XT_ERROR_TARGET | 217 | #define IPT_ERROR_TARGET XT_ERROR_TARGET |
| 220 | 218 | ||
| 221 | /* Helper functions */ | 219 | /* Helper functions */ |
| 222 | static __inline__ struct ipt_entry_target * | 220 | static __inline__ struct xt_entry_target * |
| 223 | ipt_get_target(struct ipt_entry *e) | 221 | ipt_get_target(struct ipt_entry *e) |
| 224 | { | 222 | { |
| 225 | return (void *)e + e->target_offset; | 223 | return (void *)e + e->target_offset; |
| @@ -251,11 +249,11 @@ extern void ipt_unregister_table(struct net *net, struct xt_table *table); | |||
| 251 | /* Standard entry. */ | 249 | /* Standard entry. */ |
| 252 | struct ipt_standard { | 250 | struct ipt_standard { |
| 253 | struct ipt_entry entry; | 251 | struct ipt_entry entry; |
| 254 | struct ipt_standard_target target; | 252 | struct xt_standard_target target; |
| 255 | }; | 253 | }; |
| 256 | 254 | ||
| 257 | struct ipt_error_target { | 255 | struct ipt_error_target { |
| 258 | struct ipt_entry_target target; | 256 | struct xt_entry_target target; |
| 259 | char errorname[XT_FUNCTION_MAXNAMELEN]; | 257 | char errorname[XT_FUNCTION_MAXNAMELEN]; |
| 260 | }; | 258 | }; |
| 261 | 259 | ||
| @@ -309,7 +307,7 @@ struct compat_ipt_entry { | |||
| 309 | }; | 307 | }; |
| 310 | 308 | ||
| 311 | /* Helper functions */ | 309 | /* Helper functions */ |
| 312 | static inline struct ipt_entry_target * | 310 | static inline struct xt_entry_target * |
| 313 | compat_ipt_get_target(struct compat_ipt_entry *e) | 311 | compat_ipt_get_target(struct compat_ipt_entry *e) |
| 314 | { | 312 | { |
| 315 | return (void *)e + e->target_offset; | 313 | return (void *)e + e->target_offset; |
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index abe31d020e3c..40d11fa05840 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
| @@ -34,6 +34,10 @@ | |||
| 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 | #define ip6t_entry_match xt_entry_match | ||
| 38 | #define ip6t_entry_target xt_entry_target | ||
| 39 | #define ip6t_standard_target xt_standard_target | ||
| 40 | #define ip6t_counters xt_counters | ||
| 37 | #endif | 41 | #endif |
| 38 | 42 | ||
| 39 | /* Yes, Virginia, you have to zero the padding. */ | 43 | /* Yes, Virginia, you have to zero the padding. */ |
| @@ -63,12 +67,6 @@ struct ip6t_ip6 { | |||
| 63 | u_int8_t invflags; | 67 | u_int8_t invflags; |
| 64 | }; | 68 | }; |
| 65 | 69 | ||
| 66 | #define ip6t_entry_match xt_entry_match | ||
| 67 | #define ip6t_entry_target xt_entry_target | ||
| 68 | #define ip6t_standard_target xt_standard_target | ||
| 69 | |||
| 70 | #define ip6t_counters xt_counters | ||
| 71 | |||
| 72 | /* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */ | 70 | /* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */ |
| 73 | #define IP6T_F_PROTO 0x01 /* Set if rule cares about upper | 71 | #define IP6T_F_PROTO 0x01 /* Set if rule cares about upper |
| 74 | protocols */ | 72 | protocols */ |
| @@ -113,11 +111,11 @@ struct ip6t_entry { | |||
| 113 | /* Standard entry */ | 111 | /* Standard entry */ |
| 114 | struct ip6t_standard { | 112 | struct ip6t_standard { |
| 115 | struct ip6t_entry entry; | 113 | struct ip6t_entry entry; |
| 116 | struct ip6t_standard_target target; | 114 | struct xt_standard_target target; |
| 117 | }; | 115 | }; |
| 118 | 116 | ||
| 119 | struct ip6t_error_target { | 117 | struct ip6t_error_target { |
| 120 | struct ip6t_entry_target target; | 118 | struct xt_entry_target target; |
| 121 | char errorname[XT_FUNCTION_MAXNAMELEN]; | 119 | char errorname[XT_FUNCTION_MAXNAMELEN]; |
| 122 | }; | 120 | }; |
| 123 | 121 | ||
| @@ -136,7 +134,7 @@ struct ip6t_error { | |||
| 136 | { \ | 134 | { \ |
| 137 | .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_standard)), \ | 135 | .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_standard)), \ |
| 138 | .target = XT_TARGET_INIT(IP6T_STANDARD_TARGET, \ | 136 | .target = XT_TARGET_INIT(IP6T_STANDARD_TARGET, \ |
| 139 | sizeof(struct ip6t_standard_target)), \ | 137 | sizeof(struct xt_standard_target)), \ |
| 140 | .target.verdict = -(__verdict) - 1, \ | 138 | .target.verdict = -(__verdict) - 1, \ |
| 141 | } | 139 | } |
| 142 | 140 | ||
| @@ -275,7 +273,7 @@ struct ip6t_get_entries { | |||
| 275 | #define IP6T_ERROR_TARGET XT_ERROR_TARGET | 273 | #define IP6T_ERROR_TARGET XT_ERROR_TARGET |
| 276 | 274 | ||
| 277 | /* Helper functions */ | 275 | /* Helper functions */ |
| 278 | static __inline__ struct ip6t_entry_target * | 276 | static __inline__ struct xt_entry_target * |
| 279 | ip6t_get_target(struct ip6t_entry *e) | 277 | ip6t_get_target(struct ip6t_entry *e) |
| 280 | { | 278 | { |
| 281 | return (void *)e + e->target_offset; | 279 | return (void *)e + e->target_offset; |
| @@ -332,7 +330,7 @@ struct compat_ip6t_entry { | |||
| 332 | unsigned char elems[0]; | 330 | unsigned char elems[0]; |
| 333 | }; | 331 | }; |
| 334 | 332 | ||
| 335 | static inline struct ip6t_entry_target * | 333 | static inline struct xt_entry_target * |
| 336 | compat_ip6t_get_target(struct compat_ip6t_entry *e) | 334 | compat_ip6t_get_target(struct compat_ip6t_entry *e) |
| 337 | { | 335 | { |
| 338 | return (void *)e + e->target_offset; | 336 | return (void *)e + e->target_offset; |
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c index e427a9e3c489..ed178cbe6626 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c | |||
| @@ -228,7 +228,7 @@ arpt_error(struct sk_buff *skb, const struct xt_action_param *par) | |||
| 228 | return NF_DROP; | 228 | return NF_DROP; |
| 229 | } | 229 | } |
| 230 | 230 | ||
| 231 | static inline const struct arpt_entry_target * | 231 | static inline const struct xt_entry_target * |
| 232 | arpt_get_target_c(const struct arpt_entry *e) | 232 | arpt_get_target_c(const struct arpt_entry *e) |
| 233 | { | 233 | { |
| 234 | return arpt_get_target((struct arpt_entry *)e); | 234 | return arpt_get_target((struct arpt_entry *)e); |
| @@ -282,7 +282,7 @@ unsigned int arpt_do_table(struct sk_buff *skb, | |||
| 282 | 282 | ||
| 283 | arp = arp_hdr(skb); | 283 | arp = arp_hdr(skb); |
| 284 | do { | 284 | do { |
| 285 | const struct arpt_entry_target *t; | 285 | const struct xt_entry_target *t; |
| 286 | 286 | ||
| 287 | if (!arp_packet_match(arp, skb->dev, indev, outdev, &e->arp)) { | 287 | if (!arp_packet_match(arp, skb->dev, indev, outdev, &e->arp)) { |
| 288 | e = arpt_next_entry(e); | 288 | e = arpt_next_entry(e); |
| @@ -297,7 +297,7 @@ unsigned int arpt_do_table(struct sk_buff *skb, | |||
| 297 | if (!t->u.kernel.target->target) { | 297 | if (!t->u.kernel.target->target) { |
| 298 | int v; | 298 | int v; |
| 299 | 299 | ||
| 300 | v = ((struct arpt_standard_target *)t)->verdict; | 300 | v = ((struct xt_standard_target *)t)->verdict; |
| 301 | if (v < 0) { | 301 | if (v < 0) { |
| 302 | /* Pop from stack? */ | 302 | /* Pop from stack? */ |
| 303 | if (v != ARPT_RETURN) { | 303 | if (v != ARPT_RETURN) { |
| @@ -377,7 +377,7 @@ static int mark_source_chains(const struct xt_table_info *newinfo, | |||
| 377 | e->counters.pcnt = pos; | 377 | e->counters.pcnt = pos; |
| 378 | 378 | ||
| 379 | for (;;) { | 379 | for (;;) { |
| 380 | const struct arpt_standard_target *t | 380 | const struct xt_standard_target *t |
| 381 | = (void *)arpt_get_target_c(e); | 381 | = (void *)arpt_get_target_c(e); |
| 382 | int visited = e->comefrom & (1 << hook); | 382 | int visited = e->comefrom & (1 << hook); |
| 383 | 383 | ||
| @@ -464,14 +464,14 @@ static int mark_source_chains(const struct xt_table_info *newinfo, | |||
| 464 | 464 | ||
| 465 | static inline int check_entry(const struct arpt_entry *e, const char *name) | 465 | static inline int check_entry(const struct arpt_entry *e, const char *name) |
| 466 | { | 466 | { |
| 467 | const struct arpt_entry_target *t; | 467 | const struct xt_entry_target *t; |
| 468 | 468 | ||
| 469 | if (!arp_checkentry(&e->arp)) { | 469 | if (!arp_checkentry(&e->arp)) { |
| 470 | duprintf("arp_tables: arp check failed %p %s.\n", e, name); | 470 | duprintf("arp_tables: arp check failed %p %s.\n", e, name); |
| 471 | return -EINVAL; | 471 | return -EINVAL; |
| 472 | } | 472 | } |
| 473 | 473 | ||
| 474 | if (e->target_offset + sizeof(struct arpt_entry_target) > e->next_offset) | 474 | if (e->target_offset + sizeof(struct xt_entry_target) > e->next_offset) |
| 475 | return -EINVAL; | 475 | return -EINVAL; |
| 476 | 476 | ||
| 477 | t = arpt_get_target_c(e); | 477 | t = arpt_get_target_c(e); |
| @@ -483,7 +483,7 @@ static inline int check_entry(const struct arpt_entry *e, const char *name) | |||
| 483 | 483 | ||
| 484 | static inline int check_target(struct arpt_entry *e, const char *name) | 484 | static inline int check_target(struct arpt_entry *e, const char *name) |
| 485 | { | 485 | { |
| 486 | struct arpt_entry_target *t = arpt_get_target(e); | 486 | struct xt_entry_target *t = arpt_get_target(e); |
| 487 | int ret; | 487 | int ret; |
| 488 | struct xt_tgchk_param par = { | 488 | struct xt_tgchk_param par = { |
| 489 | .table = name, | 489 | .table = name, |
| @@ -506,7 +506,7 @@ static inline int check_target(struct arpt_entry *e, const char *name) | |||
| 506 | static inline int | 506 | static inline int |
| 507 | find_check_entry(struct arpt_entry *e, const char *name, unsigned int size) | 507 | find_check_entry(struct arpt_entry *e, const char *name, unsigned int size) |
| 508 | { | 508 | { |
| 509 | struct arpt_entry_target *t; | 509 | struct xt_entry_target *t; |
| 510 | struct xt_target *target; | 510 | struct xt_target *target; |
| 511 | int ret; | 511 | int ret; |
| 512 | 512 | ||
| @@ -536,7 +536,7 @@ out: | |||
| 536 | 536 | ||
| 537 | static bool check_underflow(const struct arpt_entry *e) | 537 | static bool check_underflow(const struct arpt_entry *e) |
| 538 | { | 538 | { |
| 539 | const struct arpt_entry_target *t; | 539 | const struct xt_entry_target *t; |
| 540 | unsigned int verdict; | 540 | unsigned int verdict; |
| 541 | 541 | ||
| 542 | if (!unconditional(&e->arp)) | 542 | if (!unconditional(&e->arp)) |
| @@ -544,7 +544,7 @@ static bool check_underflow(const struct arpt_entry *e) | |||
| 544 | t = arpt_get_target_c(e); | 544 | t = arpt_get_target_c(e); |
| 545 | if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0) | 545 | if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0) |
| 546 | return false; | 546 | return false; |
| 547 | verdict = ((struct arpt_standard_target *)t)->verdict; | 547 | verdict = ((struct xt_standard_target *)t)->verdict; |
| 548 | verdict = -verdict - 1; | 548 | verdict = -verdict - 1; |
| 549 | return verdict == NF_DROP || verdict == NF_ACCEPT; | 549 | return verdict == NF_DROP || verdict == NF_ACCEPT; |
| 550 | } | 550 | } |
| @@ -566,7 +566,7 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e, | |||
| 566 | } | 566 | } |
| 567 | 567 | ||
| 568 | if (e->next_offset | 568 | if (e->next_offset |
| 569 | < sizeof(struct arpt_entry) + sizeof(struct arpt_entry_target)) { | 569 | < sizeof(struct arpt_entry) + sizeof(struct xt_entry_target)) { |
| 570 | duprintf("checking: element %p size %u\n", | 570 | duprintf("checking: element %p size %u\n", |
| 571 | e, e->next_offset); | 571 | e, e->next_offset); |
| 572 | return -EINVAL; | 572 | return -EINVAL; |
| @@ -598,7 +598,7 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e, | |||
| 598 | static inline void cleanup_entry(struct arpt_entry *e) | 598 | static inline void cleanup_entry(struct arpt_entry *e) |
| 599 | { | 599 | { |
| 600 | struct xt_tgdtor_param par; | 600 | struct xt_tgdtor_param par; |
| 601 | struct arpt_entry_target *t; | 601 | struct xt_entry_target *t; |
| 602 | 602 | ||
| 603 | t = arpt_get_target(e); | 603 | t = arpt_get_target(e); |
| 604 | par.target = t->u.kernel.target; | 604 | par.target = t->u.kernel.target; |
| @@ -794,7 +794,7 @@ static int copy_entries_to_user(unsigned int total_size, | |||
| 794 | /* FIXME: use iterator macros --RR */ | 794 | /* FIXME: use iterator macros --RR */ |
| 795 | /* ... then go back and fix counters and names */ | 795 | /* ... then go back and fix counters and names */ |
| 796 | for (off = 0, num = 0; off < total_size; off += e->next_offset, num++){ | 796 | for (off = 0, num = 0; off < total_size; off += e->next_offset, num++){ |
| 797 | const struct arpt_entry_target *t; | 797 | const struct xt_entry_target *t; |
| 798 | 798 | ||
| 799 | e = (struct arpt_entry *)(loc_cpu_entry + off); | 799 | e = (struct arpt_entry *)(loc_cpu_entry + off); |
| 800 | if (copy_to_user(userptr + off | 800 | if (copy_to_user(userptr + off |
| @@ -807,7 +807,7 @@ static int copy_entries_to_user(unsigned int total_size, | |||
| 807 | 807 | ||
| 808 | t = arpt_get_target_c(e); | 808 | t = arpt_get_target_c(e); |
| 809 | if (copy_to_user(userptr + off + e->target_offset | 809 | if (copy_to_user(userptr + off + e->target_offset |
| 810 | + offsetof(struct arpt_entry_target, | 810 | + offsetof(struct xt_entry_target, |
| 811 | u.user.name), | 811 | u.user.name), |
| 812 | t->u.kernel.target->name, | 812 | t->u.kernel.target->name, |
| 813 | strlen(t->u.kernel.target->name)+1) != 0) { | 813 | strlen(t->u.kernel.target->name)+1) != 0) { |
| @@ -844,7 +844,7 @@ static int compat_calc_entry(const struct arpt_entry *e, | |||
| 844 | const struct xt_table_info *info, | 844 | const struct xt_table_info *info, |
| 845 | const void *base, struct xt_table_info *newinfo) | 845 | const void *base, struct xt_table_info *newinfo) |
| 846 | { | 846 | { |
| 847 | const struct arpt_entry_target *t; | 847 | const struct xt_entry_target *t; |
| 848 | unsigned int entry_offset; | 848 | unsigned int entry_offset; |
| 849 | int off, i, ret; | 849 | int off, i, ret; |
| 850 | 850 | ||
| @@ -1204,7 +1204,7 @@ static int do_add_counters(struct net *net, const void __user *user, | |||
| 1204 | #ifdef CONFIG_COMPAT | 1204 | #ifdef CONFIG_COMPAT |
| 1205 | static inline void compat_release_entry(struct compat_arpt_entry *e) | 1205 | static inline void compat_release_entry(struct compat_arpt_entry *e) |
| 1206 | { | 1206 | { |
| 1207 | struct arpt_entry_target *t; | 1207 | struct xt_entry_target *t; |
| 1208 | 1208 | ||
| 1209 | t = compat_arpt_get_target(e); | 1209 | t = compat_arpt_get_target(e); |
| 1210 | module_put(t->u.kernel.target->me); | 1210 | module_put(t->u.kernel.target->me); |
| @@ -1220,7 +1220,7 @@ check_compat_entry_size_and_hooks(struct compat_arpt_entry *e, | |||
| 1220 | const unsigned int *underflows, | 1220 | const unsigned int *underflows, |
| 1221 | const char *name) | 1221 | const char *name) |
| 1222 | { | 1222 | { |
| 1223 | struct arpt_entry_target *t; | 1223 | struct xt_entry_target *t; |
| 1224 | struct xt_target *target; | 1224 | struct xt_target *target; |
| 1225 | unsigned int entry_offset; | 1225 | unsigned int entry_offset; |
| 1226 | int ret, off, h; | 1226 | int ret, off, h; |
| @@ -1288,7 +1288,7 @@ compat_copy_entry_from_user(struct compat_arpt_entry *e, void **dstptr, | |||
| 1288 | unsigned int *size, const char *name, | 1288 | unsigned int *size, const char *name, |
| 1289 | struct xt_table_info *newinfo, unsigned char *base) | 1289 | struct xt_table_info *newinfo, unsigned char *base) |
| 1290 | { | 1290 | { |
| 1291 | struct arpt_entry_target *t; | 1291 | struct xt_entry_target *t; |
| 1292 | struct xt_target *target; | 1292 | struct xt_target *target; |
| 1293 | struct arpt_entry *de; | 1293 | struct arpt_entry *de; |
| 1294 | unsigned int origsize; | 1294 | unsigned int origsize; |
| @@ -1567,7 +1567,7 @@ static int compat_copy_entry_to_user(struct arpt_entry *e, void __user **dstptr, | |||
| 1567 | struct xt_counters *counters, | 1567 | struct xt_counters *counters, |
| 1568 | unsigned int i) | 1568 | unsigned int i) |
| 1569 | { | 1569 | { |
| 1570 | struct arpt_entry_target *t; | 1570 | struct xt_entry_target *t; |
| 1571 | struct compat_arpt_entry __user *ce; | 1571 | struct compat_arpt_entry __user *ce; |
| 1572 | u_int16_t target_offset, next_offset; | 1572 | u_int16_t target_offset, next_offset; |
| 1573 | compat_uint_t origsize; | 1573 | compat_uint_t origsize; |
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 2efd41bef452..cb108880050a 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
| @@ -186,7 +186,7 @@ static inline bool unconditional(const struct ipt_ip *ip) | |||
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | /* for const-correctness */ | 188 | /* for const-correctness */ |
| 189 | static inline const struct ipt_entry_target * | 189 | static inline const struct xt_entry_target * |
| 190 | ipt_get_target_c(const struct ipt_entry *e) | 190 | ipt_get_target_c(const struct ipt_entry *e) |
| 191 | { | 191 | { |
| 192 | return ipt_get_target((struct ipt_entry *)e); | 192 | return ipt_get_target((struct ipt_entry *)e); |
| @@ -230,7 +230,7 @@ get_chainname_rulenum(const struct ipt_entry *s, const struct ipt_entry *e, | |||
| 230 | const char *hookname, const char **chainname, | 230 | const char *hookname, const char **chainname, |
| 231 | const char **comment, unsigned int *rulenum) | 231 | const char **comment, unsigned int *rulenum) |
| 232 | { | 232 | { |
| 233 | const struct ipt_standard_target *t = (void *)ipt_get_target_c(s); | 233 | const struct xt_standard_target *t = (void *)ipt_get_target_c(s); |
| 234 | 234 | ||
| 235 | if (strcmp(t->target.u.kernel.target->name, IPT_ERROR_TARGET) == 0) { | 235 | if (strcmp(t->target.u.kernel.target->name, IPT_ERROR_TARGET) == 0) { |
| 236 | /* Head of user chain: ERROR target with chainname */ | 236 | /* Head of user chain: ERROR target with chainname */ |
| @@ -346,7 +346,7 @@ ipt_do_table(struct sk_buff *skb, | |||
| 346 | get_entry(table_base, private->underflow[hook])); | 346 | get_entry(table_base, private->underflow[hook])); |
| 347 | 347 | ||
| 348 | do { | 348 | do { |
| 349 | const struct ipt_entry_target *t; | 349 | const struct xt_entry_target *t; |
| 350 | const struct xt_entry_match *ematch; | 350 | const struct xt_entry_match *ematch; |
| 351 | 351 | ||
| 352 | IP_NF_ASSERT(e); | 352 | IP_NF_ASSERT(e); |
| @@ -380,7 +380,7 @@ ipt_do_table(struct sk_buff *skb, | |||
| 380 | if (!t->u.kernel.target->target) { | 380 | if (!t->u.kernel.target->target) { |
| 381 | int v; | 381 | int v; |
| 382 | 382 | ||
| 383 | v = ((struct ipt_standard_target *)t)->verdict; | 383 | v = ((struct xt_standard_target *)t)->verdict; |
| 384 | if (v < 0) { | 384 | if (v < 0) { |
| 385 | /* Pop from stack? */ | 385 | /* Pop from stack? */ |
| 386 | if (v != IPT_RETURN) { | 386 | if (v != IPT_RETURN) { |
| @@ -461,7 +461,7 @@ mark_source_chains(const struct xt_table_info *newinfo, | |||
| 461 | e->counters.pcnt = pos; | 461 | e->counters.pcnt = pos; |
| 462 | 462 | ||
| 463 | for (;;) { | 463 | for (;;) { |
| 464 | const struct ipt_standard_target *t | 464 | const struct xt_standard_target *t |
| 465 | = (void *)ipt_get_target_c(e); | 465 | = (void *)ipt_get_target_c(e); |
| 466 | int visited = e->comefrom & (1 << hook); | 466 | int visited = e->comefrom & (1 << hook); |
| 467 | 467 | ||
| @@ -552,7 +552,7 @@ mark_source_chains(const struct xt_table_info *newinfo, | |||
| 552 | return 1; | 552 | return 1; |
| 553 | } | 553 | } |
| 554 | 554 | ||
| 555 | static void cleanup_match(struct ipt_entry_match *m, struct net *net) | 555 | static void cleanup_match(struct xt_entry_match *m, struct net *net) |
| 556 | { | 556 | { |
| 557 | struct xt_mtdtor_param par; | 557 | struct xt_mtdtor_param par; |
| 558 | 558 | ||
| @@ -568,14 +568,14 @@ static void cleanup_match(struct ipt_entry_match *m, struct net *net) | |||
| 568 | static int | 568 | static int |
| 569 | check_entry(const struct ipt_entry *e, const char *name) | 569 | check_entry(const struct ipt_entry *e, const char *name) |
| 570 | { | 570 | { |
| 571 | const struct ipt_entry_target *t; | 571 | const struct xt_entry_target *t; |
| 572 | 572 | ||
| 573 | if (!ip_checkentry(&e->ip)) { | 573 | if (!ip_checkentry(&e->ip)) { |
| 574 | duprintf("ip check failed %p %s.\n", e, par->match->name); | 574 | duprintf("ip check failed %p %s.\n", e, par->match->name); |
| 575 | return -EINVAL; | 575 | return -EINVAL; |
| 576 | } | 576 | } |
| 577 | 577 | ||
| 578 | if (e->target_offset + sizeof(struct ipt_entry_target) > | 578 | if (e->target_offset + sizeof(struct xt_entry_target) > |
| 579 | e->next_offset) | 579 | e->next_offset) |
| 580 | return -EINVAL; | 580 | return -EINVAL; |
| 581 | 581 | ||
| @@ -587,7 +587,7 @@ check_entry(const struct ipt_entry *e, const char *name) | |||
| 587 | } | 587 | } |
| 588 | 588 | ||
| 589 | static int | 589 | static int |
| 590 | check_match(struct ipt_entry_match *m, struct xt_mtchk_param *par) | 590 | check_match(struct xt_entry_match *m, struct xt_mtchk_param *par) |
| 591 | { | 591 | { |
| 592 | const struct ipt_ip *ip = par->entryinfo; | 592 | const struct ipt_ip *ip = par->entryinfo; |
| 593 | int ret; | 593 | int ret; |
| @@ -605,7 +605,7 @@ check_match(struct ipt_entry_match *m, struct xt_mtchk_param *par) | |||
| 605 | } | 605 | } |
| 606 | 606 | ||
| 607 | static int | 607 | static int |
| 608 | find_check_match(struct ipt_entry_match *m, struct xt_mtchk_param *par) | 608 | find_check_match(struct xt_entry_match *m, struct xt_mtchk_param *par) |
| 609 | { | 609 | { |
| 610 | struct xt_match *match; | 610 | struct xt_match *match; |
| 611 | int ret; | 611 | int ret; |
| @@ -630,7 +630,7 @@ err: | |||
| 630 | 630 | ||
| 631 | static int check_target(struct ipt_entry *e, struct net *net, const char *name) | 631 | static int check_target(struct ipt_entry *e, struct net *net, const char *name) |
| 632 | { | 632 | { |
| 633 | struct ipt_entry_target *t = ipt_get_target(e); | 633 | struct xt_entry_target *t = ipt_get_target(e); |
| 634 | struct xt_tgchk_param par = { | 634 | struct xt_tgchk_param par = { |
| 635 | .net = net, | 635 | .net = net, |
| 636 | .table = name, | 636 | .table = name, |
| @@ -656,7 +656,7 @@ static int | |||
| 656 | find_check_entry(struct ipt_entry *e, struct net *net, const char *name, | 656 | find_check_entry(struct ipt_entry *e, struct net *net, const char *name, |
| 657 | unsigned int size) | 657 | unsigned int size) |
| 658 | { | 658 | { |
| 659 | struct ipt_entry_target *t; | 659 | struct xt_entry_target *t; |
| 660 | struct xt_target *target; | 660 | struct xt_target *target; |
| 661 | int ret; | 661 | int ret; |
| 662 | unsigned int j; | 662 | unsigned int j; |
| @@ -707,7 +707,7 @@ find_check_entry(struct ipt_entry *e, struct net *net, const char *name, | |||
| 707 | 707 | ||
| 708 | static bool check_underflow(const struct ipt_entry *e) | 708 | static bool check_underflow(const struct ipt_entry *e) |
| 709 | { | 709 | { |
| 710 | const struct ipt_entry_target *t; | 710 | const struct xt_entry_target *t; |
| 711 | unsigned int verdict; | 711 | unsigned int verdict; |
| 712 | 712 | ||
| 713 | if (!unconditional(&e->ip)) | 713 | if (!unconditional(&e->ip)) |
| @@ -715,7 +715,7 @@ static bool check_underflow(const struct ipt_entry *e) | |||
| 715 | t = ipt_get_target_c(e); | 715 | t = ipt_get_target_c(e); |
| 716 | if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0) | 716 | if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0) |
| 717 | return false; | 717 | return false; |
| 718 | verdict = ((struct ipt_standard_target *)t)->verdict; | 718 | verdict = ((struct xt_standard_target *)t)->verdict; |
| 719 | verdict = -verdict - 1; | 719 | verdict = -verdict - 1; |
| 720 | return verdict == NF_DROP || verdict == NF_ACCEPT; | 720 | return verdict == NF_DROP || verdict == NF_ACCEPT; |
| 721 | } | 721 | } |
| @@ -738,7 +738,7 @@ check_entry_size_and_hooks(struct ipt_entry *e, | |||
| 738 | } | 738 | } |
| 739 | 739 | ||
| 740 | if (e->next_offset | 740 | if (e->next_offset |
| 741 | < sizeof(struct ipt_entry) + sizeof(struct ipt_entry_target)) { | 741 | < sizeof(struct ipt_entry) + sizeof(struct xt_entry_target)) { |
| 742 | duprintf("checking: element %p size %u\n", | 742 | duprintf("checking: element %p size %u\n", |
| 743 | e, e->next_offset); | 743 | e, e->next_offset); |
| 744 | return -EINVAL; | 744 | return -EINVAL; |
| @@ -771,7 +771,7 @@ static void | |||
| 771 | cleanup_entry(struct ipt_entry *e, struct net *net) | 771 | cleanup_entry(struct ipt_entry *e, struct net *net) |
| 772 | { | 772 | { |
| 773 | struct xt_tgdtor_param par; | 773 | struct xt_tgdtor_param par; |
| 774 | struct ipt_entry_target *t; | 774 | struct xt_entry_target *t; |
| 775 | struct xt_entry_match *ematch; | 775 | struct xt_entry_match *ematch; |
| 776 | 776 | ||
| 777 | /* Cleanup all matches */ | 777 | /* Cleanup all matches */ |
| @@ -972,8 +972,8 @@ copy_entries_to_user(unsigned int total_size, | |||
| 972 | /* ... then go back and fix counters and names */ | 972 | /* ... then go back and fix counters and names */ |
| 973 | for (off = 0, num = 0; off < total_size; off += e->next_offset, num++){ | 973 | for (off = 0, num = 0; off < total_size; off += e->next_offset, num++){ |
| 974 | unsigned int i; | 974 | unsigned int i; |
| 975 | const struct ipt_entry_match *m; | 975 | const struct xt_entry_match *m; |
| 976 | const struct ipt_entry_target *t; | 976 | const struct xt_entry_target *t; |
| 977 | 977 | ||
| 978 | e = (struct ipt_entry *)(loc_cpu_entry + off); | 978 | e = (struct ipt_entry *)(loc_cpu_entry + off); |
| 979 | if (copy_to_user(userptr + off | 979 | if (copy_to_user(userptr + off |
| @@ -990,7 +990,7 @@ copy_entries_to_user(unsigned int total_size, | |||
| 990 | m = (void *)e + i; | 990 | m = (void *)e + i; |
| 991 | 991 | ||
| 992 | if (copy_to_user(userptr + off + i | 992 | if (copy_to_user(userptr + off + i |
| 993 | + offsetof(struct ipt_entry_match, | 993 | + offsetof(struct xt_entry_match, |
| 994 | u.user.name), | 994 | u.user.name), |
| 995 | m->u.kernel.match->name, | 995 | m->u.kernel.match->name, |
| 996 | strlen(m->u.kernel.match->name)+1) | 996 | strlen(m->u.kernel.match->name)+1) |
| @@ -1002,7 +1002,7 @@ copy_entries_to_user(unsigned int total_size, | |||
| 1002 | 1002 | ||
| 1003 | t = ipt_get_target_c(e); | 1003 | t = ipt_get_target_c(e); |
| 1004 | if (copy_to_user(userptr + off + e->target_offset | 1004 | if (copy_to_user(userptr + off + e->target_offset |
| 1005 | + offsetof(struct ipt_entry_target, | 1005 | + offsetof(struct xt_entry_target, |
| 1006 | u.user.name), | 1006 | u.user.name), |
| 1007 | t->u.kernel.target->name, | 1007 | t->u.kernel.target->name, |
| 1008 | strlen(t->u.kernel.target->name)+1) != 0) { | 1008 | strlen(t->u.kernel.target->name)+1) != 0) { |
| @@ -1040,7 +1040,7 @@ static int compat_calc_entry(const struct ipt_entry *e, | |||
| 1040 | const void *base, struct xt_table_info *newinfo) | 1040 | const void *base, struct xt_table_info *newinfo) |
| 1041 | { | 1041 | { |
| 1042 | const struct xt_entry_match *ematch; | 1042 | const struct xt_entry_match *ematch; |
| 1043 | const struct ipt_entry_target *t; | 1043 | const struct xt_entry_target *t; |
| 1044 | unsigned int entry_offset; | 1044 | unsigned int entry_offset; |
| 1045 | int off, i, ret; | 1045 | int off, i, ret; |
| 1046 | 1046 | ||
| @@ -1407,7 +1407,7 @@ struct compat_ipt_replace { | |||
| 1407 | u32 hook_entry[NF_INET_NUMHOOKS]; | 1407 | u32 hook_entry[NF_INET_NUMHOOKS]; |
| 1408 | u32 underflow[NF_INET_NUMHOOKS]; | 1408 | u32 underflow[NF_INET_NUMHOOKS]; |
| 1409 | u32 num_counters; | 1409 | u32 num_counters; |
| 1410 | compat_uptr_t counters; /* struct ipt_counters * */ | 1410 | compat_uptr_t counters; /* struct xt_counters * */ |
| 1411 | struct compat_ipt_entry entries[0]; | 1411 | struct compat_ipt_entry entries[0]; |
| 1412 | }; | 1412 | }; |
| 1413 | 1413 | ||
| @@ -1416,7 +1416,7 @@ compat_copy_entry_to_user(struct ipt_entry *e, void __user **dstptr, | |||
| 1416 | unsigned int *size, struct xt_counters *counters, | 1416 | unsigned int *size, struct xt_counters *counters, |
| 1417 | unsigned int i) | 1417 | unsigned int i) |
| 1418 | { | 1418 | { |
| 1419 | struct ipt_entry_target *t; | 1419 | struct xt_entry_target *t; |
| 1420 | struct compat_ipt_entry __user *ce; | 1420 | struct compat_ipt_entry __user *ce; |
| 1421 | u_int16_t target_offset, next_offset; | 1421 | u_int16_t target_offset, next_offset; |
| 1422 | compat_uint_t origsize; | 1422 | compat_uint_t origsize; |
| @@ -1451,7 +1451,7 @@ compat_copy_entry_to_user(struct ipt_entry *e, void __user **dstptr, | |||
| 1451 | } | 1451 | } |
| 1452 | 1452 | ||
| 1453 | static int | 1453 | static int |
| 1454 | compat_find_calc_match(struct ipt_entry_match *m, | 1454 | compat_find_calc_match(struct xt_entry_match *m, |
| 1455 | const char *name, | 1455 | const char *name, |
| 1456 | const struct ipt_ip *ip, | 1456 | const struct ipt_ip *ip, |
| 1457 | unsigned int hookmask, | 1457 | unsigned int hookmask, |
| @@ -1473,7 +1473,7 @@ compat_find_calc_match(struct ipt_entry_match *m, | |||
| 1473 | 1473 | ||
| 1474 | static void compat_release_entry(struct compat_ipt_entry *e) | 1474 | static void compat_release_entry(struct compat_ipt_entry *e) |
| 1475 | { | 1475 | { |
| 1476 | struct ipt_entry_target *t; | 1476 | struct xt_entry_target *t; |
| 1477 | struct xt_entry_match *ematch; | 1477 | struct xt_entry_match *ematch; |
| 1478 | 1478 | ||
| 1479 | /* Cleanup all matches */ | 1479 | /* Cleanup all matches */ |
| @@ -1494,7 +1494,7 @@ check_compat_entry_size_and_hooks(struct compat_ipt_entry *e, | |||
| 1494 | const char *name) | 1494 | const char *name) |
| 1495 | { | 1495 | { |
| 1496 | struct xt_entry_match *ematch; | 1496 | struct xt_entry_match *ematch; |
| 1497 | struct ipt_entry_target *t; | 1497 | struct xt_entry_target *t; |
| 1498 | struct xt_target *target; | 1498 | struct xt_target *target; |
| 1499 | unsigned int entry_offset; | 1499 | unsigned int entry_offset; |
| 1500 | unsigned int j; | 1500 | unsigned int j; |
| @@ -1576,7 +1576,7 @@ compat_copy_entry_from_user(struct compat_ipt_entry *e, void **dstptr, | |||
| 1576 | unsigned int *size, const char *name, | 1576 | unsigned int *size, const char *name, |
| 1577 | struct xt_table_info *newinfo, unsigned char *base) | 1577 | struct xt_table_info *newinfo, unsigned char *base) |
| 1578 | { | 1578 | { |
| 1579 | struct ipt_entry_target *t; | 1579 | struct xt_entry_target *t; |
| 1580 | struct xt_target *target; | 1580 | struct xt_target *target; |
| 1581 | struct ipt_entry *de; | 1581 | struct ipt_entry *de; |
| 1582 | unsigned int origsize; | 1582 | unsigned int origsize; |
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 4b973e13952d..c7334c10a4b3 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
| @@ -215,7 +215,7 @@ static inline bool unconditional(const struct ip6t_ip6 *ipv6) | |||
| 215 | return memcmp(ipv6, &uncond, sizeof(uncond)) == 0; | 215 | return memcmp(ipv6, &uncond, sizeof(uncond)) == 0; |
| 216 | } | 216 | } |
| 217 | 217 | ||
| 218 | static inline const struct ip6t_entry_target * | 218 | static inline const struct xt_entry_target * |
| 219 | ip6t_get_target_c(const struct ip6t_entry *e) | 219 | ip6t_get_target_c(const struct ip6t_entry *e) |
| 220 | { | 220 | { |
| 221 | return ip6t_get_target((struct ip6t_entry *)e); | 221 | return ip6t_get_target((struct ip6t_entry *)e); |
| @@ -260,7 +260,7 @@ get_chainname_rulenum(const struct ip6t_entry *s, const struct ip6t_entry *e, | |||
| 260 | const char *hookname, const char **chainname, | 260 | const char *hookname, const char **chainname, |
| 261 | const char **comment, unsigned int *rulenum) | 261 | const char **comment, unsigned int *rulenum) |
| 262 | { | 262 | { |
| 263 | const struct ip6t_standard_target *t = (void *)ip6t_get_target_c(s); | 263 | const struct xt_standard_target *t = (void *)ip6t_get_target_c(s); |
| 264 | 264 | ||
| 265 | if (strcmp(t->target.u.kernel.target->name, IP6T_ERROR_TARGET) == 0) { | 265 | if (strcmp(t->target.u.kernel.target->name, IP6T_ERROR_TARGET) == 0) { |
| 266 | /* Head of user chain: ERROR target with chainname */ | 266 | /* Head of user chain: ERROR target with chainname */ |
| @@ -369,7 +369,7 @@ ip6t_do_table(struct sk_buff *skb, | |||
| 369 | e = get_entry(table_base, private->hook_entry[hook]); | 369 | e = get_entry(table_base, private->hook_entry[hook]); |
| 370 | 370 | ||
| 371 | do { | 371 | do { |
| 372 | const struct ip6t_entry_target *t; | 372 | const struct xt_entry_target *t; |
| 373 | const struct xt_entry_match *ematch; | 373 | const struct xt_entry_match *ematch; |
| 374 | 374 | ||
| 375 | IP_NF_ASSERT(e); | 375 | IP_NF_ASSERT(e); |
| @@ -403,7 +403,7 @@ ip6t_do_table(struct sk_buff *skb, | |||
| 403 | if (!t->u.kernel.target->target) { | 403 | if (!t->u.kernel.target->target) { |
| 404 | int v; | 404 | int v; |
| 405 | 405 | ||
| 406 | v = ((struct ip6t_standard_target *)t)->verdict; | 406 | v = ((struct xt_standard_target *)t)->verdict; |
| 407 | if (v < 0) { | 407 | if (v < 0) { |
| 408 | /* Pop from stack? */ | 408 | /* Pop from stack? */ |
| 409 | if (v != IP6T_RETURN) { | 409 | if (v != IP6T_RETURN) { |
| @@ -474,7 +474,7 @@ mark_source_chains(const struct xt_table_info *newinfo, | |||
| 474 | e->counters.pcnt = pos; | 474 | e->counters.pcnt = pos; |
| 475 | 475 | ||
| 476 | for (;;) { | 476 | for (;;) { |
| 477 | const struct ip6t_standard_target *t | 477 | const struct xt_standard_target *t |
| 478 | = (void *)ip6t_get_target_c(e); | 478 | = (void *)ip6t_get_target_c(e); |
| 479 | int visited = e->comefrom & (1 << hook); | 479 | int visited = e->comefrom & (1 << hook); |
| 480 | 480 | ||
| @@ -565,7 +565,7 @@ mark_source_chains(const struct xt_table_info *newinfo, | |||
| 565 | return 1; | 565 | return 1; |
| 566 | } | 566 | } |
| 567 | 567 | ||
| 568 | static void cleanup_match(struct ip6t_entry_match *m, struct net *net) | 568 | static void cleanup_match(struct xt_entry_match *m, struct net *net) |
| 569 | { | 569 | { |
| 570 | struct xt_mtdtor_param par; | 570 | struct xt_mtdtor_param par; |
| 571 | 571 | ||
| @@ -581,14 +581,14 @@ static void cleanup_match(struct ip6t_entry_match *m, struct net *net) | |||
| 581 | static int | 581 | static int |
| 582 | check_entry(const struct ip6t_entry *e, const char *name) | 582 | check_entry(const struct ip6t_entry *e, const char *name) |
| 583 | { | 583 | { |
| 584 | const struct ip6t_entry_target *t; | 584 | const struct xt_entry_target *t; |
| 585 | 585 | ||
| 586 | if (!ip6_checkentry(&e->ipv6)) { | 586 | if (!ip6_checkentry(&e->ipv6)) { |
| 587 | duprintf("ip_tables: ip check failed %p %s.\n", e, name); | 587 | duprintf("ip_tables: ip check failed %p %s.\n", e, name); |
| 588 | return -EINVAL; | 588 | return -EINVAL; |
| 589 | } | 589 | } |
| 590 | 590 | ||
| 591 | if (e->target_offset + sizeof(struct ip6t_entry_target) > | 591 | if (e->target_offset + sizeof(struct xt_entry_target) > |
| 592 | e->next_offset) | 592 | e->next_offset) |
| 593 | return -EINVAL; | 593 | return -EINVAL; |
| 594 | 594 | ||
| @@ -599,7 +599,7 @@ check_entry(const struct ip6t_entry *e, const char *name) | |||
| 599 | return 0; | 599 | return 0; |
| 600 | } | 600 | } |
| 601 | 601 | ||
| 602 | static int check_match(struct ip6t_entry_match *m, struct xt_mtchk_param *par) | 602 | static int check_match(struct xt_entry_match *m, struct xt_mtchk_param *par) |
| 603 | { | 603 | { |
| 604 | const struct ip6t_ip6 *ipv6 = par->entryinfo; | 604 | const struct ip6t_ip6 *ipv6 = par->entryinfo; |
| 605 | int ret; | 605 | int ret; |
| @@ -618,7 +618,7 @@ static int check_match(struct ip6t_entry_match *m, struct xt_mtchk_param *par) | |||
| 618 | } | 618 | } |
| 619 | 619 | ||
| 620 | static int | 620 | static int |
| 621 | find_check_match(struct ip6t_entry_match *m, struct xt_mtchk_param *par) | 621 | find_check_match(struct xt_entry_match *m, struct xt_mtchk_param *par) |
| 622 | { | 622 | { |
| 623 | struct xt_match *match; | 623 | struct xt_match *match; |
| 624 | int ret; | 624 | int ret; |
| @@ -643,7 +643,7 @@ err: | |||
| 643 | 643 | ||
| 644 | static int check_target(struct ip6t_entry *e, struct net *net, const char *name) | 644 | static int check_target(struct ip6t_entry *e, struct net *net, const char *name) |
| 645 | { | 645 | { |
| 646 | struct ip6t_entry_target *t = ip6t_get_target(e); | 646 | struct xt_entry_target *t = ip6t_get_target(e); |
| 647 | struct xt_tgchk_param par = { | 647 | struct xt_tgchk_param par = { |
| 648 | .net = net, | 648 | .net = net, |
| 649 | .table = name, | 649 | .table = name, |
| @@ -670,7 +670,7 @@ static int | |||
| 670 | find_check_entry(struct ip6t_entry *e, struct net *net, const char *name, | 670 | find_check_entry(struct ip6t_entry *e, struct net *net, const char *name, |
| 671 | unsigned int size) | 671 | unsigned int size) |
| 672 | { | 672 | { |
| 673 | struct ip6t_entry_target *t; | 673 | struct xt_entry_target *t; |
| 674 | struct xt_target *target; | 674 | struct xt_target *target; |
| 675 | int ret; | 675 | int ret; |
| 676 | unsigned int j; | 676 | unsigned int j; |
| @@ -721,7 +721,7 @@ find_check_entry(struct ip6t_entry *e, struct net *net, const char *name, | |||
| 721 | 721 | ||
| 722 | static bool check_underflow(const struct ip6t_entry *e) | 722 | static bool check_underflow(const struct ip6t_entry *e) |
| 723 | { | 723 | { |
| 724 | const struct ip6t_entry_target *t; | 724 | const struct xt_entry_target *t; |
| 725 | unsigned int verdict; | 725 | unsigned int verdict; |
| 726 | 726 | ||
| 727 | if (!unconditional(&e->ipv6)) | 727 | if (!unconditional(&e->ipv6)) |
| @@ -729,7 +729,7 @@ static bool check_underflow(const struct ip6t_entry *e) | |||
| 729 | t = ip6t_get_target_c(e); | 729 | t = ip6t_get_target_c(e); |
| 730 | if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0) | 730 | if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0) |
| 731 | return false; | 731 | return false; |
| 732 | verdict = ((struct ip6t_standard_target *)t)->verdict; | 732 | verdict = ((struct xt_standard_target *)t)->verdict; |
| 733 | verdict = -verdict - 1; | 733 | verdict = -verdict - 1; |
| 734 | return verdict == NF_DROP || verdict == NF_ACCEPT; | 734 | return verdict == NF_DROP || verdict == NF_ACCEPT; |
| 735 | } | 735 | } |
| @@ -752,7 +752,7 @@ check_entry_size_and_hooks(struct ip6t_entry *e, | |||
| 752 | } | 752 | } |
| 753 | 753 | ||
| 754 | if (e->next_offset | 754 | if (e->next_offset |
| 755 | < sizeof(struct ip6t_entry) + sizeof(struct ip6t_entry_target)) { | 755 | < sizeof(struct ip6t_entry) + sizeof(struct xt_entry_target)) { |
| 756 | duprintf("checking: element %p size %u\n", | 756 | duprintf("checking: element %p size %u\n", |
| 757 | e, e->next_offset); | 757 | e, e->next_offset); |
| 758 | return -EINVAL; | 758 | return -EINVAL; |
| @@ -784,7 +784,7 @@ check_entry_size_and_hooks(struct ip6t_entry *e, | |||
| 784 | static void cleanup_entry(struct ip6t_entry *e, struct net *net) | 784 | static void cleanup_entry(struct ip6t_entry *e, struct net *net) |
| 785 | { | 785 | { |
| 786 | struct xt_tgdtor_param par; | 786 | struct xt_tgdtor_param par; |
| 787 | struct ip6t_entry_target *t; | 787 | struct xt_entry_target *t; |
| 788 | struct xt_entry_match *ematch; | 788 | struct xt_entry_match *ematch; |
| 789 | 789 | ||
| 790 | /* Cleanup all matches */ | 790 | /* Cleanup all matches */ |
| @@ -985,8 +985,8 @@ copy_entries_to_user(unsigned int total_size, | |||
| 985 | /* ... then go back and fix counters and names */ | 985 | /* ... then go back and fix counters and names */ |
| 986 | for (off = 0, num = 0; off < total_size; off += e->next_offset, num++){ | 986 | for (off = 0, num = 0; off < total_size; off += e->next_offset, num++){ |
| 987 | unsigned int i; | 987 | unsigned int i; |
| 988 | const struct ip6t_entry_match *m; | 988 | const struct xt_entry_match *m; |
| 989 | const struct ip6t_entry_target *t; | 989 | const struct xt_entry_target *t; |
| 990 | 990 | ||
| 991 | e = (struct ip6t_entry *)(loc_cpu_entry + off); | 991 | e = (struct ip6t_entry *)(loc_cpu_entry + off); |
| 992 | if (copy_to_user(userptr + off | 992 | if (copy_to_user(userptr + off |
| @@ -1003,7 +1003,7 @@ copy_entries_to_user(unsigned int total_size, | |||
| 1003 | m = (void *)e + i; | 1003 | m = (void *)e + i; |
| 1004 | 1004 | ||
| 1005 | if (copy_to_user(userptr + off + i | 1005 | if (copy_to_user(userptr + off + i |
| 1006 | + offsetof(struct ip6t_entry_match, | 1006 | + offsetof(struct xt_entry_match, |
| 1007 | u.user.name), | 1007 | u.user.name), |
| 1008 | m->u.kernel.match->name, | 1008 | m->u.kernel.match->name, |
| 1009 | strlen(m->u.kernel.match->name)+1) | 1009 | strlen(m->u.kernel.match->name)+1) |
| @@ -1015,7 +1015,7 @@ copy_entries_to_user(unsigned int total_size, | |||
| 1015 | 1015 | ||
| 1016 | t = ip6t_get_target_c(e); | 1016 | t = ip6t_get_target_c(e); |
| 1017 | if (copy_to_user(userptr + off + e->target_offset | 1017 | if (copy_to_user(userptr + off + e->target_offset |
| 1018 | + offsetof(struct ip6t_entry_target, | 1018 | + offsetof(struct xt_entry_target, |
| 1019 | u.user.name), | 1019 | u.user.name), |
| 1020 | t->u.kernel.target->name, | 1020 | t->u.kernel.target->name, |
| 1021 | strlen(t->u.kernel.target->name)+1) != 0) { | 1021 | strlen(t->u.kernel.target->name)+1) != 0) { |
| @@ -1053,7 +1053,7 @@ static int compat_calc_entry(const struct ip6t_entry *e, | |||
| 1053 | const void *base, struct xt_table_info *newinfo) | 1053 | const void *base, struct xt_table_info *newinfo) |
| 1054 | { | 1054 | { |
| 1055 | const struct xt_entry_match *ematch; | 1055 | const struct xt_entry_match *ematch; |
| 1056 | const struct ip6t_entry_target *t; | 1056 | const struct xt_entry_target *t; |
| 1057 | unsigned int entry_offset; | 1057 | unsigned int entry_offset; |
| 1058 | int off, i, ret; | 1058 | int off, i, ret; |
| 1059 | 1059 | ||
| @@ -1422,7 +1422,7 @@ struct compat_ip6t_replace { | |||
| 1422 | u32 hook_entry[NF_INET_NUMHOOKS]; | 1422 | u32 hook_entry[NF_INET_NUMHOOKS]; |
| 1423 | u32 underflow[NF_INET_NUMHOOKS]; | 1423 | u32 underflow[NF_INET_NUMHOOKS]; |
| 1424 | u32 num_counters; | 1424 | u32 num_counters; |
| 1425 | compat_uptr_t counters; /* struct ip6t_counters * */ | 1425 | compat_uptr_t counters; /* struct xt_counters * */ |
| 1426 | struct compat_ip6t_entry entries[0]; | 1426 | struct compat_ip6t_entry entries[0]; |
| 1427 | }; | 1427 | }; |
| 1428 | 1428 | ||
| @@ -1431,7 +1431,7 @@ compat_copy_entry_to_user(struct ip6t_entry *e, void __user **dstptr, | |||
| 1431 | unsigned int *size, struct xt_counters *counters, | 1431 | unsigned int *size, struct xt_counters *counters, |
| 1432 | unsigned int i) | 1432 | unsigned int i) |
| 1433 | { | 1433 | { |
| 1434 | struct ip6t_entry_target *t; | 1434 | struct xt_entry_target *t; |
| 1435 | struct compat_ip6t_entry __user *ce; | 1435 | struct compat_ip6t_entry __user *ce; |
| 1436 | u_int16_t target_offset, next_offset; | 1436 | u_int16_t target_offset, next_offset; |
| 1437 | compat_uint_t origsize; | 1437 | compat_uint_t origsize; |
| @@ -1466,7 +1466,7 @@ compat_copy_entry_to_user(struct ip6t_entry *e, void __user **dstptr, | |||
| 1466 | } | 1466 | } |
| 1467 | 1467 | ||
| 1468 | static int | 1468 | static int |
| 1469 | compat_find_calc_match(struct ip6t_entry_match *m, | 1469 | compat_find_calc_match(struct xt_entry_match *m, |
| 1470 | const char *name, | 1470 | const char *name, |
| 1471 | const struct ip6t_ip6 *ipv6, | 1471 | const struct ip6t_ip6 *ipv6, |
| 1472 | unsigned int hookmask, | 1472 | unsigned int hookmask, |
| @@ -1488,7 +1488,7 @@ compat_find_calc_match(struct ip6t_entry_match *m, | |||
| 1488 | 1488 | ||
| 1489 | static void compat_release_entry(struct compat_ip6t_entry *e) | 1489 | static void compat_release_entry(struct compat_ip6t_entry *e) |
| 1490 | { | 1490 | { |
| 1491 | struct ip6t_entry_target *t; | 1491 | struct xt_entry_target *t; |
| 1492 | struct xt_entry_match *ematch; | 1492 | struct xt_entry_match *ematch; |
| 1493 | 1493 | ||
| 1494 | /* Cleanup all matches */ | 1494 | /* Cleanup all matches */ |
| @@ -1509,7 +1509,7 @@ check_compat_entry_size_and_hooks(struct compat_ip6t_entry *e, | |||
| 1509 | const char *name) | 1509 | const char *name) |
| 1510 | { | 1510 | { |
| 1511 | struct xt_entry_match *ematch; | 1511 | struct xt_entry_match *ematch; |
| 1512 | struct ip6t_entry_target *t; | 1512 | struct xt_entry_target *t; |
| 1513 | struct xt_target *target; | 1513 | struct xt_target *target; |
| 1514 | unsigned int entry_offset; | 1514 | unsigned int entry_offset; |
| 1515 | unsigned int j; | 1515 | unsigned int j; |
| @@ -1591,7 +1591,7 @@ compat_copy_entry_from_user(struct compat_ip6t_entry *e, void **dstptr, | |||
| 1591 | unsigned int *size, const char *name, | 1591 | unsigned int *size, const char *name, |
| 1592 | struct xt_table_info *newinfo, unsigned char *base) | 1592 | struct xt_table_info *newinfo, unsigned char *base) |
| 1593 | { | 1593 | { |
| 1594 | struct ip6t_entry_target *t; | 1594 | struct xt_entry_target *t; |
| 1595 | struct xt_target *target; | 1595 | struct xt_target *target; |
| 1596 | struct ip6t_entry *de; | 1596 | struct ip6t_entry *de; |
| 1597 | unsigned int origsize; | 1597 | unsigned int origsize; |
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c index c7e59e6ec349..f6d464f993ef 100644 --- a/net/sched/act_ipt.c +++ b/net/sched/act_ipt.c | |||
| @@ -39,7 +39,7 @@ static struct tcf_hashinfo ipt_hash_info = { | |||
| 39 | .lock = &ipt_lock, | 39 | .lock = &ipt_lock, |
| 40 | }; | 40 | }; |
| 41 | 41 | ||
| 42 | static int ipt_init_target(struct ipt_entry_target *t, char *table, unsigned int hook) | 42 | static int ipt_init_target(struct xt_entry_target *t, char *table, unsigned int hook) |
| 43 | { | 43 | { |
| 44 | struct xt_tgchk_param par; | 44 | struct xt_tgchk_param par; |
| 45 | struct xt_target *target; | 45 | struct xt_target *target; |
| @@ -66,7 +66,7 @@ static int ipt_init_target(struct ipt_entry_target *t, char *table, unsigned int | |||
| 66 | return 0; | 66 | return 0; |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | static void ipt_destroy_target(struct ipt_entry_target *t) | 69 | static void ipt_destroy_target(struct xt_entry_target *t) |
| 70 | { | 70 | { |
| 71 | struct xt_tgdtor_param par = { | 71 | struct xt_tgdtor_param par = { |
| 72 | .target = t->u.kernel.target, | 72 | .target = t->u.kernel.target, |
| @@ -99,7 +99,7 @@ static const struct nla_policy ipt_policy[TCA_IPT_MAX + 1] = { | |||
| 99 | [TCA_IPT_TABLE] = { .type = NLA_STRING, .len = IFNAMSIZ }, | 99 | [TCA_IPT_TABLE] = { .type = NLA_STRING, .len = IFNAMSIZ }, |
| 100 | [TCA_IPT_HOOK] = { .type = NLA_U32 }, | 100 | [TCA_IPT_HOOK] = { .type = NLA_U32 }, |
| 101 | [TCA_IPT_INDEX] = { .type = NLA_U32 }, | 101 | [TCA_IPT_INDEX] = { .type = NLA_U32 }, |
| 102 | [TCA_IPT_TARG] = { .len = sizeof(struct ipt_entry_target) }, | 102 | [TCA_IPT_TARG] = { .len = sizeof(struct xt_entry_target) }, |
| 103 | }; | 103 | }; |
| 104 | 104 | ||
| 105 | static int tcf_ipt_init(struct nlattr *nla, struct nlattr *est, | 105 | static int tcf_ipt_init(struct nlattr *nla, struct nlattr *est, |
| @@ -108,7 +108,7 @@ static int tcf_ipt_init(struct nlattr *nla, struct nlattr *est, | |||
| 108 | struct nlattr *tb[TCA_IPT_MAX + 1]; | 108 | struct nlattr *tb[TCA_IPT_MAX + 1]; |
| 109 | struct tcf_ipt *ipt; | 109 | struct tcf_ipt *ipt; |
| 110 | struct tcf_common *pc; | 110 | struct tcf_common *pc; |
| 111 | struct ipt_entry_target *td, *t; | 111 | struct xt_entry_target *td, *t; |
| 112 | char *tname; | 112 | char *tname; |
| 113 | int ret = 0, err; | 113 | int ret = 0, err; |
| 114 | u32 hook = 0; | 114 | u32 hook = 0; |
| @@ -126,7 +126,7 @@ static int tcf_ipt_init(struct nlattr *nla, struct nlattr *est, | |||
| 126 | if (tb[TCA_IPT_TARG] == NULL) | 126 | if (tb[TCA_IPT_TARG] == NULL) |
| 127 | return -EINVAL; | 127 | return -EINVAL; |
| 128 | 128 | ||
| 129 | td = (struct ipt_entry_target *)nla_data(tb[TCA_IPT_TARG]); | 129 | td = (struct xt_entry_target *)nla_data(tb[TCA_IPT_TARG]); |
| 130 | if (nla_len(tb[TCA_IPT_TARG]) < td->u.target_size) | 130 | if (nla_len(tb[TCA_IPT_TARG]) < td->u.target_size) |
| 131 | return -EINVAL; | 131 | return -EINVAL; |
| 132 | 132 | ||
| @@ -249,7 +249,7 @@ static int tcf_ipt_dump(struct sk_buff *skb, struct tc_action *a, int bind, int | |||
| 249 | { | 249 | { |
| 250 | unsigned char *b = skb_tail_pointer(skb); | 250 | unsigned char *b = skb_tail_pointer(skb); |
| 251 | struct tcf_ipt *ipt = a->priv; | 251 | struct tcf_ipt *ipt = a->priv; |
| 252 | struct ipt_entry_target *t; | 252 | struct xt_entry_target *t; |
| 253 | struct tcf_t tm; | 253 | struct tcf_t tm; |
| 254 | struct tc_cnt c; | 254 | struct tc_cnt c; |
| 255 | 255 | ||
