diff options
| author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-02 15:47:12 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-02 15:47:12 -0400 |
| commit | bacd3add087770333bdce65cd3dd25e3b2cd67ac (patch) | |
| tree | b9a5512a7abbf661020af87ee843e4ad711546ed /include/linux | |
| parent | 29e350944fdc2dfca102500790d8ad6d6ff4f69d (diff) | |
| parent | 9a1875e60e61b563737d8d1fc3876b279710fe93 (diff) | |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[NET]: Fully fix the memory leaks in sys_accept().
[NETFILTER]: iptables 32bit compat layer
[NETFILTER]: {ip,nf}_conntrack_netlink: fix expectation notifier unregistration
[NETFILTER]: fix ifdef for connmark support in nf_conntrack_netlink
[NETFILTER]: x_tables: unify IPv4/IPv6 multiport match
[NETFILTER]: x_tables: unify IPv4/IPv6 esp match
[NET]: Fix dentry leak in sys_accept().
[IPSEC]: Kill unused decap state structure
[IPSEC]: Kill unused decap state argument
[NET]: com90xx kmalloc fix
[TG3]: Update driver version and reldate.
[TG3]: Revert "Speed up SRAM access"
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/netfilter/x_tables.h | 67 | ||||
| -rw-r--r-- | include/linux/netfilter/xt_esp.h | 14 | ||||
| -rw-r--r-- | include/linux/netfilter/xt_multiport.h | 30 | ||||
| -rw-r--r-- | include/linux/netfilter_ipv4/ip_tables.h | 18 | ||||
| -rw-r--r-- | include/linux/netfilter_ipv4/ipt_esp.h | 14 | ||||
| -rw-r--r-- | include/linux/netfilter_ipv4/ipt_multiport.h | 31 | ||||
| -rw-r--r-- | include/linux/netfilter_ipv6/ip6t_esp.h | 12 | ||||
| -rw-r--r-- | include/linux/netfilter_ipv6/ip6t_multiport.h | 25 |
8 files changed, 154 insertions, 57 deletions
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 1350e47b02..f6bdef82a3 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
| @@ -142,6 +142,12 @@ struct xt_counters_info | |||
| 142 | #define ASSERT_WRITE_LOCK(x) | 142 | #define ASSERT_WRITE_LOCK(x) |
| 143 | #include <linux/netfilter_ipv4/listhelp.h> | 143 | #include <linux/netfilter_ipv4/listhelp.h> |
| 144 | 144 | ||
| 145 | #ifdef CONFIG_COMPAT | ||
| 146 | #define COMPAT_TO_USER 1 | ||
| 147 | #define COMPAT_FROM_USER -1 | ||
| 148 | #define COMPAT_CALC_SIZE 0 | ||
| 149 | #endif | ||
| 150 | |||
| 145 | struct xt_match | 151 | struct xt_match |
| 146 | { | 152 | { |
| 147 | struct list_head list; | 153 | struct list_head list; |
| @@ -175,6 +181,9 @@ struct xt_match | |||
| 175 | void (*destroy)(const struct xt_match *match, void *matchinfo, | 181 | void (*destroy)(const struct xt_match *match, void *matchinfo, |
| 176 | unsigned int matchinfosize); | 182 | unsigned int matchinfosize); |
| 177 | 183 | ||
| 184 | /* Called when userspace align differs from kernel space one */ | ||
| 185 | int (*compat)(void *match, void **dstptr, int *size, int convert); | ||
| 186 | |||
| 178 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 187 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
| 179 | struct module *me; | 188 | struct module *me; |
| 180 | 189 | ||
| @@ -220,6 +229,9 @@ struct xt_target | |||
| 220 | void (*destroy)(const struct xt_target *target, void *targinfo, | 229 | void (*destroy)(const struct xt_target *target, void *targinfo, |
| 221 | unsigned int targinfosize); | 230 | unsigned int targinfosize); |
| 222 | 231 | ||
| 232 | /* Called when userspace align differs from kernel space one */ | ||
| 233 | int (*compat)(void *target, void **dstptr, int *size, int convert); | ||
| 234 | |||
| 223 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 235 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
| 224 | struct module *me; | 236 | struct module *me; |
| 225 | 237 | ||
| @@ -314,6 +326,61 @@ extern void xt_proto_fini(int af); | |||
| 314 | extern struct xt_table_info *xt_alloc_table_info(unsigned int size); | 326 | extern struct xt_table_info *xt_alloc_table_info(unsigned int size); |
| 315 | extern void xt_free_table_info(struct xt_table_info *info); | 327 | extern void xt_free_table_info(struct xt_table_info *info); |
| 316 | 328 | ||
| 329 | #ifdef CONFIG_COMPAT | ||
| 330 | #include <net/compat.h> | ||
| 331 | |||
| 332 | struct compat_xt_entry_match | ||
| 333 | { | ||
| 334 | union { | ||
| 335 | struct { | ||
| 336 | u_int16_t match_size; | ||
| 337 | char name[XT_FUNCTION_MAXNAMELEN - 1]; | ||
| 338 | u_int8_t revision; | ||
| 339 | } user; | ||
| 340 | u_int16_t match_size; | ||
| 341 | } u; | ||
| 342 | unsigned char data[0]; | ||
| 343 | }; | ||
| 344 | |||
| 345 | struct compat_xt_entry_target | ||
| 346 | { | ||
| 347 | union { | ||
| 348 | struct { | ||
| 349 | u_int16_t target_size; | ||
| 350 | char name[XT_FUNCTION_MAXNAMELEN - 1]; | ||
| 351 | u_int8_t revision; | ||
| 352 | } user; | ||
| 353 | u_int16_t target_size; | ||
| 354 | } u; | ||
| 355 | unsigned char data[0]; | ||
| 356 | }; | ||
| 357 | |||
| 358 | /* FIXME: this works only on 32 bit tasks | ||
| 359 | * need to change whole approach in order to calculate align as function of | ||
| 360 | * current task alignment */ | ||
| 361 | |||
| 362 | struct compat_xt_counters | ||
| 363 | { | ||
| 364 | u_int32_t cnt[4]; | ||
| 365 | }; | ||
| 366 | |||
| 367 | struct compat_xt_counters_info | ||
| 368 | { | ||
| 369 | char name[XT_TABLE_MAXNAMELEN]; | ||
| 370 | compat_uint_t num_counters; | ||
| 371 | struct compat_xt_counters counters[0]; | ||
| 372 | }; | ||
| 373 | |||
| 374 | #define COMPAT_XT_ALIGN(s) (((s) + (__alignof__(struct compat_xt_counters)-1)) \ | ||
| 375 | & ~(__alignof__(struct compat_xt_counters)-1)) | ||
| 376 | |||
| 377 | extern void xt_compat_lock(int af); | ||
| 378 | extern void xt_compat_unlock(int af); | ||
| 379 | extern int xt_compat_match(void *match, void **dstptr, int *size, int convert); | ||
| 380 | extern int xt_compat_target(void *target, void **dstptr, int *size, | ||
| 381 | int convert); | ||
| 382 | |||
| 383 | #endif /* CONFIG_COMPAT */ | ||
| 317 | #endif /* __KERNEL__ */ | 384 | #endif /* __KERNEL__ */ |
| 318 | 385 | ||
| 319 | #endif /* _X_TABLES_H */ | 386 | #endif /* _X_TABLES_H */ |
diff --git a/include/linux/netfilter/xt_esp.h b/include/linux/netfilter/xt_esp.h new file mode 100644 index 0000000000..9380fb1c27 --- /dev/null +++ b/include/linux/netfilter/xt_esp.h | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #ifndef _XT_ESP_H | ||
| 2 | #define _XT_ESP_H | ||
| 3 | |||
| 4 | struct xt_esp | ||
| 5 | { | ||
| 6 | u_int32_t spis[2]; /* Security Parameter Index */ | ||
| 7 | u_int8_t invflags; /* Inverse flags */ | ||
| 8 | }; | ||
| 9 | |||
| 10 | /* Values for "invflags" field in struct xt_esp. */ | ||
| 11 | #define XT_ESP_INV_SPI 0x01 /* Invert the sense of spi. */ | ||
| 12 | #define XT_ESP_INV_MASK 0x01 /* All possible flags. */ | ||
| 13 | |||
| 14 | #endif /*_XT_ESP_H*/ | ||
diff --git a/include/linux/netfilter/xt_multiport.h b/include/linux/netfilter/xt_multiport.h new file mode 100644 index 0000000000..d49ee41837 --- /dev/null +++ b/include/linux/netfilter/xt_multiport.h | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | #ifndef _XT_MULTIPORT_H | ||
| 2 | #define _XT_MULTIPORT_H | ||
| 3 | |||
| 4 | enum xt_multiport_flags | ||
| 5 | { | ||
| 6 | XT_MULTIPORT_SOURCE, | ||
| 7 | XT_MULTIPORT_DESTINATION, | ||
| 8 | XT_MULTIPORT_EITHER | ||
| 9 | }; | ||
| 10 | |||
| 11 | #define XT_MULTI_PORTS 15 | ||
| 12 | |||
| 13 | /* Must fit inside union xt_matchinfo: 16 bytes */ | ||
| 14 | struct xt_multiport | ||
| 15 | { | ||
| 16 | u_int8_t flags; /* Type of comparison */ | ||
| 17 | u_int8_t count; /* Number of ports */ | ||
| 18 | u_int16_t ports[XT_MULTI_PORTS]; /* Ports */ | ||
| 19 | }; | ||
| 20 | |||
| 21 | struct xt_multiport_v1 | ||
| 22 | { | ||
| 23 | u_int8_t flags; /* Type of comparison */ | ||
| 24 | u_int8_t count; /* Number of ports */ | ||
| 25 | u_int16_t ports[XT_MULTI_PORTS]; /* Ports */ | ||
| 26 | u_int8_t pflags[XT_MULTI_PORTS]; /* Port flags */ | ||
| 27 | u_int8_t invert; /* Invert flag */ | ||
| 28 | }; | ||
| 29 | |||
| 30 | #endif /*_XT_MULTIPORT_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index d5b8c0d6a1..c0dac16e19 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
| @@ -316,5 +316,23 @@ extern unsigned int ipt_do_table(struct sk_buff **pskb, | |||
| 316 | void *userdata); | 316 | void *userdata); |
| 317 | 317 | ||
| 318 | #define IPT_ALIGN(s) XT_ALIGN(s) | 318 | #define IPT_ALIGN(s) XT_ALIGN(s) |
| 319 | |||
| 320 | #ifdef CONFIG_COMPAT | ||
| 321 | #include <net/compat.h> | ||
| 322 | |||
| 323 | struct compat_ipt_entry | ||
| 324 | { | ||
| 325 | struct ipt_ip ip; | ||
| 326 | compat_uint_t nfcache; | ||
| 327 | u_int16_t target_offset; | ||
| 328 | u_int16_t next_offset; | ||
| 329 | compat_uint_t comefrom; | ||
| 330 | struct compat_xt_counters counters; | ||
| 331 | unsigned char elems[0]; | ||
| 332 | }; | ||
| 333 | |||
| 334 | #define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s) | ||
| 335 | |||
| 336 | #endif /* CONFIG_COMPAT */ | ||
| 319 | #endif /*__KERNEL__*/ | 337 | #endif /*__KERNEL__*/ |
| 320 | #endif /* _IPTABLES_H */ | 338 | #endif /* _IPTABLES_H */ |
diff --git a/include/linux/netfilter_ipv4/ipt_esp.h b/include/linux/netfilter_ipv4/ipt_esp.h index c782a83e53..78296e7eef 100644 --- a/include/linux/netfilter_ipv4/ipt_esp.h +++ b/include/linux/netfilter_ipv4/ipt_esp.h | |||
| @@ -1,16 +1,10 @@ | |||
| 1 | #ifndef _IPT_ESP_H | 1 | #ifndef _IPT_ESP_H |
| 2 | #define _IPT_ESP_H | 2 | #define _IPT_ESP_H |
| 3 | 3 | ||
| 4 | struct ipt_esp | 4 | #include <linux/netfilter/xt_esp.h> |
| 5 | { | ||
| 6 | u_int32_t spis[2]; /* Security Parameter Index */ | ||
| 7 | u_int8_t invflags; /* Inverse flags */ | ||
| 8 | }; | ||
| 9 | 5 | ||
| 10 | < | ||
