diff options
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/arp.h | 8 | ||||
-rw-r--r-- | include/net/esp.h | 54 | ||||
-rw-r--r-- | include/net/inet6_hashtables.h | 17 | ||||
-rw-r--r-- | include/net/inet_hashtables.h | 55 | ||||
-rw-r--r-- | include/net/ip_fib.h | 4 | ||||
-rw-r--r-- | include/net/net_namespace.h | 4 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack.h | 15 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_core.h | 6 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_expect.h | 2 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_helper.h | 4 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_l3proto.h | 4 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_l4proto.h | 25 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_tuple.h | 17 | ||||
-rw-r--r-- | include/net/netfilter/nf_log.h | 2 | ||||
-rw-r--r-- | include/net/netns/ipv4.h | 6 | ||||
-rw-r--r-- | include/net/netns/ipv6.h | 5 | ||||
-rw-r--r-- | include/net/netns/x_tables.h | 10 | ||||
-rw-r--r-- | include/net/pkt_cls.h | 6 | ||||
-rw-r--r-- | include/net/raw.h | 5 | ||||
-rw-r--r-- | include/net/route.h | 3 | ||||
-rw-r--r-- | include/net/sock.h | 2 | ||||
-rw-r--r-- | include/net/xfrm.h | 16 |
22 files changed, 143 insertions, 127 deletions
diff --git a/include/net/arp.h b/include/net/arp.h index 752eb47b2678..c236270ec95e 100644 --- a/include/net/arp.h +++ b/include/net/arp.h | |||
@@ -13,15 +13,17 @@ extern int arp_find(unsigned char *haddr, struct sk_buff *skb); | |||
13 | extern int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg); | 13 | extern int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg); |
14 | extern void arp_send(int type, int ptype, __be32 dest_ip, | 14 | extern void arp_send(int type, int ptype, __be32 dest_ip, |
15 | struct net_device *dev, __be32 src_ip, | 15 | struct net_device *dev, __be32 src_ip, |
16 | unsigned char *dest_hw, unsigned char *src_hw, unsigned char *th); | 16 | const unsigned char *dest_hw, |
17 | const unsigned char *src_hw, const unsigned char *th); | ||
17 | extern int arp_bind_neighbour(struct dst_entry *dst); | 18 | extern int arp_bind_neighbour(struct dst_entry *dst); |
18 | extern int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir); | 19 | extern int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir); |
19 | extern void arp_ifdown(struct net_device *dev); | 20 | extern void arp_ifdown(struct net_device *dev); |
20 | 21 | ||
21 | extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, | 22 | extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, |
22 | struct net_device *dev, __be32 src_ip, | 23 | struct net_device *dev, __be32 src_ip, |
23 | unsigned char *dest_hw, unsigned char *src_hw, | 24 | const unsigned char *dest_hw, |
24 | unsigned char *target_hw); | 25 | const unsigned char *src_hw, |
26 | const unsigned char *target_hw); | ||
25 | extern void arp_xmit(struct sk_buff *skb); | 27 | extern void arp_xmit(struct sk_buff *skb); |
26 | 28 | ||
27 | extern struct neigh_ops arp_broken_ops; | 29 | extern struct neigh_ops arp_broken_ops; |
diff --git a/include/net/esp.h b/include/net/esp.h index c05f529bff28..d58451331dbd 100644 --- a/include/net/esp.h +++ b/include/net/esp.h | |||
@@ -1,58 +1,20 @@ | |||
1 | #ifndef _NET_ESP_H | 1 | #ifndef _NET_ESP_H |
2 | #define _NET_ESP_H | 2 | #define _NET_ESP_H |
3 | 3 | ||
4 | #include <linux/crypto.h> | 4 | #include <linux/skbuff.h> |
5 | #include <net/xfrm.h> | ||
6 | #include <linux/scatterlist.h> | ||
7 | 5 | ||
8 | #define ESP_NUM_FAST_SG 4 | 6 | struct crypto_aead; |
9 | 7 | ||
10 | struct esp_data | 8 | struct esp_data { |
11 | { | 9 | /* 0..255 */ |
12 | struct scatterlist sgbuf[ESP_NUM_FAST_SG]; | 10 | int padlen; |
13 | 11 | ||
14 | /* Confidentiality */ | 12 | /* Confidentiality & Integrity */ |
15 | struct { | 13 | struct crypto_aead *aead; |
16 | int padlen; /* 0..255 */ | ||
17 | /* ivlen is offset from enc_data, where encrypted data start. | ||
18 | * It is logically different of crypto_tfm_alg_ivsize(tfm). | ||
19 | * We assume that it is either zero (no ivec), or | ||
20 | * >= crypto_tfm_alg_ivsize(tfm). */ | ||
21 | int ivlen; | ||
22 | int ivinitted; | ||
23 | u8 *ivec; /* ivec buffer */ | ||
24 | struct crypto_blkcipher *tfm; /* crypto handle */ | ||
25 | } conf; | ||
26 | |||
27 | /* Integrity. It is active when icv_full_len != 0 */ | ||
28 | struct { | ||
29 | u8 *work_icv; | ||
30 | int icv_full_len; | ||
31 | int icv_trunc_len; | ||
32 | struct crypto_hash *tfm; | ||
33 | } auth; | ||
34 | }; | 14 | }; |
35 | 15 | ||
36 | extern void *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len); | 16 | extern void *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len); |
37 | 17 | ||
38 | static inline int esp_mac_digest(struct esp_data *esp, struct sk_buff *skb, | ||
39 | int offset, int len) | ||
40 | { | ||
41 | struct hash_desc desc; | ||
42 | int err; | ||
43 | |||
44 | desc.tfm = esp->auth.tfm; | ||
45 | desc.flags = 0; | ||
46 | |||
47 | err = crypto_hash_init(&desc); | ||
48 | if (unlikely(err)) | ||
49 | return err; | ||
50 | err = skb_icv_walk(skb, &desc, offset, len, crypto_hash_update); | ||
51 | if (unlikely(err)) | ||
52 | return err; | ||
53 | return crypto_hash_final(&desc, esp->auth.work_icv); | ||
54 | } | ||
55 | |||
56 | struct ip_esp_hdr; | 18 | struct ip_esp_hdr; |
57 | 19 | ||
58 | static inline struct ip_esp_hdr *ip_esp_hdr(const struct sk_buff *skb) | 20 | static inline struct ip_esp_hdr *ip_esp_hdr(const struct sk_buff *skb) |
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h index 668056b4bb0b..fdff630708ce 100644 --- a/include/net/inet6_hashtables.h +++ b/include/net/inet6_hashtables.h | |||
@@ -57,34 +57,37 @@ extern void __inet6_hash(struct inet_hashinfo *hashinfo, struct sock *sk); | |||
57 | * | 57 | * |
58 | * The sockhash lock must be held as a reader here. | 58 | * The sockhash lock must be held as a reader here. |
59 | */ | 59 | */ |
60 | extern struct sock *__inet6_lookup_established(struct inet_hashinfo *hashinfo, | 60 | extern struct sock *__inet6_lookup_established(struct net *net, |
61 | struct inet_hashinfo *hashinfo, | ||
61 | const struct in6_addr *saddr, | 62 | const struct in6_addr *saddr, |
62 | const __be16 sport, | 63 | const __be16 sport, |
63 | const struct in6_addr *daddr, | 64 | const struct in6_addr *daddr, |
64 | const u16 hnum, | 65 | const u16 hnum, |
65 | const int dif); | 66 | const int dif); |
66 | 67 | ||
67 | extern struct sock *inet6_lookup_listener(struct inet_hashinfo *hashinfo, | 68 | extern struct sock *inet6_lookup_listener(struct net *net, |
69 | struct inet_hashinfo *hashinfo, | ||
68 | const struct in6_addr *daddr, | 70 | const struct in6_addr *daddr, |
69 | const unsigned short hnum, | 71 | const unsigned short hnum, |
70 | const int dif); | 72 | const int dif); |
71 | 73 | ||
72 | static inline struct sock *__inet6_lookup(struct inet_hashinfo *hashinfo, | 74 | static inline struct sock *__inet6_lookup(struct net *net, |
75 | struct inet_hashinfo *hashinfo, | ||
73 | const struct in6_addr *saddr, | 76 | const struct in6_addr *saddr, |
74 | const __be16 sport, | 77 | const __be16 sport, |
75 | const struct in6_addr *daddr, | 78 | const struct in6_addr *daddr, |
76 | const u16 hnum, | 79 | const u16 hnum, |
77 | const int dif) | 80 | const int dif) |
78 | { | 81 | { |
79 | struct sock *sk = __inet6_lookup_established(hashinfo, saddr, sport, | 82 | struct sock *sk = __inet6_lookup_established(net, hashinfo, saddr, |
80 | daddr, hnum, dif); | 83 | sport, daddr, hnum, dif); |
81 | if (sk) | 84 | if (sk) |
82 | return sk; | 85 | return sk; |
83 | 86 | ||
84 | return inet6_lookup_listener(hashinfo, daddr, hnum, dif); | 87 | return inet6_lookup_listener(net, hashinfo, daddr, hnum, dif); |
85 | } | 88 | } |
86 | 89 | ||
87 | extern struct sock *inet6_lookup(struct inet_hashinfo *hashinfo, | 90 | extern struct sock *inet6_lookup(struct net *net, struct inet_hashinfo *hashinfo, |
88 | const struct in6_addr *saddr, const __be16 sport, | 91 | const struct in6_addr *saddr, const __be16 sport, |
89 | const struct in6_addr *daddr, const __be16 dport, | 92 | const struct in6_addr *daddr, const __be16 dport, |
90 | const int dif); | 93 | const int dif); |
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 761bdc01425d..c23c4ed30724 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -74,6 +74,7 @@ struct inet_ehash_bucket { | |||
74 | * ports are created in O(1) time? I thought so. ;-) -DaveM | 74 | * ports are created in O(1) time? I thought so. ;-) -DaveM |
75 | */ | 75 | */ |
76 | struct inet_bind_bucket { | 76 | struct inet_bind_bucket { |
77 | struct net *ib_net; | ||
77 | unsigned short port; | 78 | unsigned short port; |
78 | signed short fastreuse; | 79 | signed short fastreuse; |
79 | struct hlist_node node; | 80 | struct hlist_node node; |
@@ -194,6 +195,7 @@ static inline void inet_ehash_locks_free(struct inet_hashinfo *hashinfo) | |||
194 | 195 | ||
195 | extern struct inet_bind_bucket * | 196 | extern struct inet_bind_bucket * |
196 | inet_bind_bucket_create(struct kmem_cache *cachep, | 197 | inet_bind_bucket_create(struct kmem_cache *cachep, |
198 | struct net *net, | ||
197 | struct inet_bind_hashbucket *head, | 199 | struct inet_bind_hashbucket *head, |
198 | const unsigned short snum); | 200 | const unsigned short snum); |
199 | extern void inet_bind_bucket_destroy(struct kmem_cache *cachep, | 201 | extern void inet_bind_bucket_destroy(struct kmem_cache *cachep, |
@@ -300,15 +302,17 @@ out: | |||
300 | wake_up(&hashinfo->lhash_wait); | 302 | wake_up(&hashinfo->lhash_wait); |
301 | } | 303 | } |
302 | 304 | ||
303 | extern struct sock *__inet_lookup_listener(struct inet_hashinfo *hashinfo, | 305 | extern struct sock *__inet_lookup_listener(struct net *net, |
306 | struct inet_hashinfo *hashinfo, | ||
304 | const __be32 daddr, | 307 | const __be32 daddr, |
305 | const unsigned short hnum, | 308 | const unsigned short hnum, |
306 | const int dif); | 309 | const int dif); |
307 | 310 | ||
308 | static inline struct sock *inet_lookup_listener(struct inet_hashinfo *hashinfo, | 311 | static inline struct sock *inet_lookup_listener(struct net *net, |
309 | __be32 daddr, __be16 dport, int dif) | 312 | struct inet_hashinfo *hashinfo, |
313 | __be32 daddr, __be16 dport, int dif) | ||
310 | { | 314 | { |
311 | return __inet_lookup_listener(hashinfo, daddr, ntohs(dport), dif); | 315 | return __inet_lookup_listener(net, hashinfo, daddr, ntohs(dport), dif); |
312 | } | 316 | } |
313 | 317 | ||
314 | /* Socket demux engine toys. */ | 318 | /* Socket demux engine toys. */ |
@@ -342,26 +346,26 @@ typedef __u64 __bitwise __addrpair; | |||
342 | (((__force __u64)(__be32)(__daddr)) << 32) | \ | 346 | (((__force __u64)(__be32)(__daddr)) << 32) | \ |
343 | ((__force __u64)(__be32)(__saddr))); | 347 | ((__force __u64)(__be32)(__saddr))); |
344 | #endif /* __BIG_ENDIAN */ | 348 | #endif /* __BIG_ENDIAN */ |
345 | #define INET_MATCH(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ | 349 | #define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ |
346 | (((__sk)->sk_hash == (__hash)) && \ | 350 | (((__sk)->sk_hash == (__hash)) && ((__sk)->sk_net == (__net)) && \ |
347 | ((*((__addrpair *)&(inet_sk(__sk)->daddr))) == (__cookie)) && \ | 351 | ((*((__addrpair *)&(inet_sk(__sk)->daddr))) == (__cookie)) && \ |
348 | ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | 352 | ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ |
349 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 353 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) |
350 | #define INET_TW_MATCH(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ | 354 | #define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ |
351 | (((__sk)->sk_hash == (__hash)) && \ | 355 | (((__sk)->sk_hash == (__hash)) && ((__sk)->sk_net == (__net)) && \ |
352 | ((*((__addrpair *)&(inet_twsk(__sk)->tw_daddr))) == (__cookie)) && \ | 356 | ((*((__addrpair *)&(inet_twsk(__sk)->tw_daddr))) == (__cookie)) && \ |
353 | ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ | 357 | ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ |
354 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 358 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) |
355 | #else /* 32-bit arch */ | 359 | #else /* 32-bit arch */ |
356 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) | 360 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) |
357 | #define INET_MATCH(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif) \ | 361 | #define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif) \ |
358 | (((__sk)->sk_hash == (__hash)) && \ | 362 | (((__sk)->sk_hash == (__hash)) && ((__sk)->sk_net == (__net)) && \ |
359 | (inet_sk(__sk)->daddr == (__saddr)) && \ | 363 | (inet_sk(__sk)->daddr == (__saddr)) && \ |
360 | (inet_sk(__sk)->rcv_saddr == (__daddr)) && \ | 364 | (inet_sk(__sk)->rcv_saddr == (__daddr)) && \ |
361 | ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | 365 | ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ |
362 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 366 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) |
363 | #define INET_TW_MATCH(__sk, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ | 367 | #define INET_TW_MATCH(__sk, __net, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ |
364 | (((__sk)->sk_hash == (__hash)) && \ | 368 | (((__sk)->sk_hash == (__hash)) && ((__sk)->sk_net == (__net)) && \ |
365 | (inet_twsk(__sk)->tw_daddr == (__saddr)) && \ | 369 | (inet_twsk(__sk)->tw_daddr == (__saddr)) && \ |
366 | (inet_twsk(__sk)->tw_rcv_saddr == (__daddr)) && \ | 370 | (inet_twsk(__sk)->tw_rcv_saddr == (__daddr)) && \ |
367 | ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ | 371 | ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ |
@@ -374,32 +378,36 @@ typedef __u64 __bitwise __addrpair; | |||
374 | * | 378 | * |
375 | * Local BH must be disabled here. | 379 | * Local BH must be disabled here. |
376 | */ | 380 | */ |
377 | extern struct sock * __inet_lookup_established(struct inet_hashinfo *hashinfo, | 381 | extern struct sock * __inet_lookup_established(struct net *net, |
382 | struct inet_hashinfo *hashinfo, | ||
378 | const __be32 saddr, const __be16 sport, | 383 | const __be32 saddr, const __be16 sport, |
379 | const __be32 daddr, const u16 hnum, const int dif); | 384 | const __be32 daddr, const u16 hnum, const int dif); |
380 | 385 | ||
381 | static inline struct sock * | 386 | static inline struct sock * |
382 | inet_lookup_established(struct inet_hashinfo *hashinfo, | 387 | inet_lookup_established(struct net *net, struct inet_hashinfo *hashinfo, |
383 | const __be32 saddr, const __be16 sport, | 388 | const __be32 saddr, const __be16 sport, |
384 | const __be32 daddr, const __be16 dport, | 389 | const __be32 daddr, const __be16 dport, |
385 | const int dif) | 390 | const int dif) |
386 | { | 391 | { |
387 | return __inet_lookup_established(hashinfo, saddr, sport, daddr, | 392 | return __inet_lookup_established(net, hashinfo, saddr, sport, daddr, |
388 | ntohs(dport), dif); | 393 | ntohs(dport), dif); |
389 | } | 394 | } |
390 | 395 | ||
391 | static inline struct sock *__inet_lookup(struct inet_hashinfo *hashinfo, | 396 | static inline struct sock *__inet_lookup(struct net *net, |
397 | struct inet_hashinfo *hashinfo, | ||
392 | const __be32 saddr, const __be16 sport, | 398 | const __be32 saddr, const __be16 sport, |
393 | const __be32 daddr, const __be16 dport, | 399 | const __be32 daddr, const __be16 dport, |
394 | const int dif) | 400 | const int dif) |
395 | { | 401 | { |
396 | u16 hnum = ntohs(dport); | 402 | u16 hnum = ntohs(dport); |
397 | struct sock *sk = __inet_lookup_established(hashinfo, saddr, sport, daddr, | 403 | struct sock *sk = __inet_lookup_established(net, hashinfo, |
398 | hnum, dif); | 404 | saddr, sport, daddr, hnum, dif); |
399 | return sk ? : __inet_lookup_listener(hashinfo, daddr, hnum, dif); | 405 | |
406 | return sk ? : __inet_lookup_listener(net, hashinfo, daddr, hnum, dif); | ||
400 | } | 407 | } |
401 | 408 | ||
402 | static inline struct sock *inet_lookup(struct inet_hashinfo *hashinfo, | 409 | static inline struct sock *inet_lookup(struct net *net, |
410 | struct inet_hashinfo *hashinfo, | ||
403 | const __be32 saddr, const __be16 sport, | 411 | const __be32 saddr, const __be16 sport, |
404 | const __be32 daddr, const __be16 dport, | 412 | const __be32 daddr, const __be16 dport, |
405 | const int dif) | 413 | const int dif) |
@@ -407,12 +415,17 @@ static inline struct sock *inet_lookup(struct inet_hashinfo *hashinfo, | |||
407 | struct sock *sk; | 415 | struct sock *sk; |
408 | 416 | ||
409 | local_bh_disable(); | 417 | local_bh_disable(); |
410 | sk = __inet_lookup(hashinfo, saddr, sport, daddr, dport, dif); | 418 | sk = __inet_lookup(net, hashinfo, saddr, sport, daddr, dport, dif); |
411 | local_bh_enable(); | 419 | local_bh_enable(); |
412 | 420 | ||
413 | return sk; | 421 | return sk; |
414 | } | 422 | } |
415 | 423 | ||
424 | extern int __inet_hash_connect(struct inet_timewait_death_row *death_row, | ||
425 | struct sock *sk, | ||
426 | int (*check_established)(struct inet_timewait_death_row *, | ||
427 | struct sock *, __u16, struct inet_timewait_sock **), | ||
428 | void (*hash)(struct inet_hashinfo *, struct sock *)); | ||
416 | extern int inet_hash_connect(struct inet_timewait_death_row *death_row, | 429 | extern int inet_hash_connect(struct inet_timewait_death_row *death_row, |
417 | struct sock *sk); | 430 | struct sock *sk); |
418 | #endif /* _INET_HASHTABLES_H */ | 431 | #endif /* _INET_HASHTABLES_H */ |
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 9daa60b544ba..90d1175f63de 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -69,6 +69,7 @@ struct fib_nh { | |||
69 | struct fib_info { | 69 | struct fib_info { |
70 | struct hlist_node fib_hash; | 70 | struct hlist_node fib_hash; |
71 | struct hlist_node fib_lhash; | 71 | struct hlist_node fib_lhash; |
72 | struct net *fib_net; | ||
72 | int fib_treeref; | 73 | int fib_treeref; |
73 | atomic_t fib_clntref; | 74 | atomic_t fib_clntref; |
74 | int fib_dead; | 75 | int fib_dead; |
@@ -218,7 +219,8 @@ extern void fib_select_default(struct net *net, const struct flowi *flp, | |||
218 | 219 | ||
219 | /* Exported by fib_semantics.c */ | 220 | /* Exported by fib_semantics.c */ |
220 | extern int ip_fib_check_default(__be32 gw, struct net_device *dev); | 221 | extern int ip_fib_check_default(__be32 gw, struct net_device *dev); |
221 | extern int fib_sync_down(__be32 local, struct net_device *dev, int force); | 222 | extern int fib_sync_down_dev(struct net_device *dev, int force); |
223 | extern int fib_sync_down_addr(struct net *net, __be32 local); | ||
222 | extern int fib_sync_up(struct net_device *dev); | 224 | extern int fib_sync_up(struct net_device *dev); |
223 | extern __be32 __fib_res_prefsrc(struct fib_result *res); | 225 | extern __be32 __fib_res_prefsrc(struct fib_result *res); |
224 | extern void fib_select_multipath(const struct flowi *flp, struct fib_result *res); | 226 | extern void fib_select_multipath(const struct flowi *flp, struct fib_result *res); |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index b8c1d60ba9e4..28738b7d53eb 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <net/netns/packet.h> | 12 | #include <net/netns/packet.h> |
13 | #include <net/netns/ipv4.h> | 13 | #include <net/netns/ipv4.h> |
14 | #include <net/netns/ipv6.h> | 14 | #include <net/netns/ipv6.h> |
15 | #include <net/netns/x_tables.h> | ||
15 | 16 | ||
16 | struct proc_dir_entry; | 17 | struct proc_dir_entry; |
17 | struct net_device; | 18 | struct net_device; |
@@ -56,6 +57,9 @@ struct net { | |||
56 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 57 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
57 | struct netns_ipv6 ipv6; | 58 | struct netns_ipv6 ipv6; |
58 | #endif | 59 | #endif |
60 | #ifdef CONFIG_NETFILTER | ||
61 | struct netns_xt xt; | ||
62 | #endif | ||
59 | }; | 63 | }; |
60 | 64 | ||
61 | #ifdef CONFIG_NET | 65 | #ifdef CONFIG_NET |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 857d89951790..90b3e7f5df5f 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -129,6 +129,8 @@ struct nf_conn | |||
129 | 129 | ||
130 | /* Extensions */ | 130 | /* Extensions */ |
131 | struct nf_ct_ext *ext; | 131 | struct nf_ct_ext *ext; |
132 | |||
133 | struct rcu_head rcu; | ||
132 | }; | 134 | }; |
133 | 135 | ||
134 | static inline struct nf_conn * | 136 | static inline struct nf_conn * |
@@ -143,7 +145,7 @@ nf_ct_tuplehash_to_ctrack(const struct nf_conntrack_tuple_hash *hash) | |||
143 | 145 | ||
144 | /* Alter reply tuple (maybe alter helper). */ | 146 | /* Alter reply tuple (maybe alter helper). */ |
145 | extern void | 147 | extern void |
146 | nf_conntrack_alter_reply(struct nf_conn *conntrack, | 148 | nf_conntrack_alter_reply(struct nf_conn *ct, |
147 | const struct nf_conntrack_tuple *newreply); | 149 | const struct nf_conntrack_tuple *newreply); |
148 | 150 | ||
149 | /* Is this tuple taken? (ignoring any belonging to the given | 151 | /* Is this tuple taken? (ignoring any belonging to the given |
@@ -171,13 +173,12 @@ static inline void nf_ct_put(struct nf_conn *ct) | |||
171 | extern int nf_ct_l3proto_try_module_get(unsigned short l3proto); | 173 | extern int nf_ct_l3proto_try_module_get(unsigned short l3proto); |
172 | extern void nf_ct_l3proto_module_put(unsigned short l3proto); | 174 | extern void nf_ct_l3proto_module_put(unsigned short l3proto); |
173 | 175 | ||
174 | extern struct hlist_head *nf_ct_alloc_hashtable(int *sizep, int *vmalloced); | 176 | extern struct hlist_head *nf_ct_alloc_hashtable(unsigned int *sizep, int *vmalloced); |
175 | extern void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced, | 177 | extern void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced, |
176 | int size); | 178 | unsigned int size); |
177 | 179 | ||
178 | extern struct nf_conntrack_tuple_hash * | 180 | extern struct nf_conntrack_tuple_hash * |
179 | __nf_conntrack_find(const struct nf_conntrack_tuple *tuple, | 181 | __nf_conntrack_find(const struct nf_conntrack_tuple *tuple); |
180 | const struct nf_conn *ignored_conntrack); | ||
181 | 182 | ||
182 | extern void nf_conntrack_hash_insert(struct nf_conn *ct); | 183 | extern void nf_conntrack_hash_insert(struct nf_conn *ct); |
183 | 184 | ||
@@ -215,9 +216,9 @@ static inline void nf_ct_refresh(struct nf_conn *ct, | |||
215 | 216 | ||
216 | /* These are for NAT. Icky. */ | 217 | /* These are for NAT. Icky. */ |
217 | /* Update TCP window tracking data when NAT mangles the packet */ | 218 | /* Update TCP window tracking data when NAT mangles the packet */ |
218 | extern void nf_conntrack_tcp_update(struct sk_buff *skb, | 219 | extern void nf_conntrack_tcp_update(const struct sk_buff *skb, |
219 | unsigned int dataoff, | 220 | unsigned int dataoff, |
220 | struct nf_conn *conntrack, | 221 | struct nf_conn *ct, |
221 | int dir); | 222 | int dir); |
222 | 223 | ||
223 | /* Fake conntrack entry for untracked connections */ | 224 | /* Fake conntrack entry for untracked connections */ |
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h index 7ad0828f05cf..9ee26469c759 100644 --- a/include/net/netfilter/nf_conntrack_core.h +++ b/include/net/netfilter/nf_conntrack_core.h | |||
@@ -68,11 +68,11 @@ static inline int nf_conntrack_confirm(struct sk_buff *skb) | |||
68 | 68 | ||
69 | int | 69 | int |
70 | print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple, | 70 | print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple, |
71 | struct nf_conntrack_l3proto *l3proto, | 71 | const struct nf_conntrack_l3proto *l3proto, |
72 | struct nf_conntrack_l4proto *proto); | 72 | const struct nf_conntrack_l4proto *proto); |
73 | 73 | ||
74 | extern struct hlist_head *nf_conntrack_hash; | 74 | extern struct hlist_head *nf_conntrack_hash; |
75 | extern rwlock_t nf_conntrack_lock ; | 75 | extern spinlock_t nf_conntrack_lock ; |
76 | extern struct hlist_head unconfirmed; | 76 | extern struct hlist_head unconfirmed; |
77 | 77 | ||
78 | #endif /* _NF_CONNTRACK_CORE_H */ | 78 | #endif /* _NF_CONNTRACK_CORE_H */ |
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h index 6c3fd254c28e..cb608a1b44e5 100644 --- a/include/net/netfilter/nf_conntrack_expect.h +++ b/include/net/netfilter/nf_conntrack_expect.h | |||
@@ -49,6 +49,8 @@ struct nf_conntrack_expect | |||
49 | /* Direction relative to the master connection. */ | 49 | /* Direction relative to the master connection. */ |
50 | enum ip_conntrack_dir dir; | 50 | enum ip_conntrack_dir dir; |
51 | #endif | 51 | #endif |
52 | |||
53 | struct rcu_head rcu; | ||
52 | }; | 54 | }; |
53 | 55 | ||
54 | #define NF_CT_EXPECT_PERMANENT 0x1 | 56 | #define NF_CT_EXPECT_PERMANENT 0x1 |
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h index 2f3af00643cf..4ca125e9b3ce 100644 --- a/include/net/netfilter/nf_conntrack_helper.h +++ b/include/net/netfilter/nf_conntrack_helper.h | |||
@@ -43,12 +43,8 @@ extern struct nf_conntrack_helper * | |||
43 | __nf_ct_helper_find(const struct nf_conntrack_tuple *tuple); | 43 | __nf_ct_helper_find(const struct nf_conntrack_tuple *tuple); |
44 | 44 | ||
45 | extern struct nf_conntrack_helper * | 45 | extern struct nf_conntrack_helper * |
46 | nf_ct_helper_find_get( const struct nf_conntrack_tuple *tuple); | ||
47 | |||
48 | extern struct nf_conntrack_helper * | ||
49 | __nf_conntrack_helper_find_byname(const char *name); | 46 | __nf_conntrack_helper_find_byname(const char *name); |
50 | 47 | ||
51 | extern void nf_ct_helper_put(struct nf_conntrack_helper *helper); | ||
52 | extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); | 48 | extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); |
53 | extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); | 49 | extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); |
54 | 50 | ||
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h index d5526bcce147..b886e3ae6cad 100644 --- a/include/net/netfilter/nf_conntrack_l3proto.h +++ b/include/net/netfilter/nf_conntrack_l3proto.h | |||
@@ -43,7 +43,7 @@ struct nf_conntrack_l3proto | |||
43 | const struct nf_conntrack_tuple *); | 43 | const struct nf_conntrack_tuple *); |
44 | 44 | ||
45 | /* Returns verdict for packet, or -1 for invalid. */ | 45 | /* Returns verdict for packet, or -1 for invalid. */ |
46 | int (*packet)(struct nf_conn *conntrack, | 46 | int (*packet)(struct nf_conn *ct, |
47 | const struct sk_buff *skb, | 47 | const struct sk_buff *skb, |
48 | enum ip_conntrack_info ctinfo); | 48 | enum ip_conntrack_info ctinfo); |
49 | 49 | ||
@@ -51,7 +51,7 @@ struct nf_conntrack_l3proto | |||
51 | * Called when a new connection for this protocol found; | 51 | * Called when a new connection for this protocol found; |
52 | * returns TRUE if it's OK. If so, packet() called next. | 52 | * returns TRUE if it's OK. If so, packet() called next. |
53 | */ | 53 | */ |
54 | int (*new)(struct nf_conn *conntrack, const struct sk_buff *skb); | 54 | int (*new)(struct nf_conn *ct, const struct sk_buff *skb); |
55 | 55 | ||
56 | /* | 56 | /* |
57 | * Called before tracking. | 57 | * Called before tracking. |
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h index fb50c217ba0a..efc16eccddb1 100644 --- a/include/net/netfilter/nf_conntrack_l4proto.h +++ b/include/net/netfilter/nf_conntrack_l4proto.h | |||
@@ -23,9 +23,6 @@ struct nf_conntrack_l4proto | |||
23 | /* L4 Protocol number. */ | 23 | /* L4 Protocol number. */ |
24 | u_int8_t l4proto; | 24 | u_int8_t l4proto; |
25 | 25 | ||
26 | /* Protocol name */ | ||
27 | const char *name; | ||
28 | |||
29 | /* Try to fill in the third arg: dataoff is offset past network protocol | 26 | /* Try to fill in the third arg: dataoff is offset past network protocol |
30 | hdr. Return true if possible. */ | 27 | hdr. Return true if possible. */ |
31 | int (*pkt_to_tuple)(const struct sk_buff *skb, | 28 | int (*pkt_to_tuple)(const struct sk_buff *skb, |
@@ -38,15 +35,8 @@ struct nf_conntrack_l4proto | |||
38 | int (*invert_tuple)(struct nf_conntrack_tuple *inverse, | 35 | int (*invert_tuple)(struct nf_conntrack_tuple *inverse, |
39 | const struct nf_conntrack_tuple *orig); | 36 | const struct nf_conntrack_tuple *orig); |
40 | 37 | ||
41 | /* Print out the per-protocol part of the tuple. Return like seq_* */ | ||
42 | int (*print_tuple)(struct seq_file *s, | ||
43 | const struct nf_conntrack_tuple *); | ||
44 | |||
45 | /* Print out the private part of the conntrack. */ | ||
46 | int (*print_conntrack)(struct seq_file *s, const struct nf_conn *); | ||
47 | |||
48 | /* Returns verdict for packet, or -1 for invalid. */ | 38 | /* Returns verdict for packet, or -1 for invalid. */ |
49 | int (*packet)(struct nf_conn *conntrack, | 39 | int (*packet)(struct nf_conn *ct, |
50 | const struct sk_buff *skb, | 40 | const struct sk_buff *skb, |
51 | unsigned int dataoff, | 41 | unsigned int dataoff, |
52 | enum ip_conntrack_info ctinfo, | 42 | enum ip_conntrack_info ctinfo, |
@@ -55,16 +45,23 @@ struct nf_conntrack_l4proto | |||
55 | 45 | ||
56 | /* Called when a new connection for this protocol found; | 46 | /* Called when a new connection for this protocol found; |
57 | * returns TRUE if it's OK. If so, packet() called next. */ | 47 | * returns TRUE if it's OK. If so, packet() called next. */ |
58 | int (*new)(struct nf_conn *conntrack, const struct sk_buff *skb, | 48 | int (*new)(struct nf_conn *ct, const struct sk_buff *skb, |
59 | unsigned int dataoff); | 49 | unsigned int dataoff); |
60 | 50 | ||
61 | /* Called when a conntrack entry is destroyed */ | 51 | /* Called when a conntrack entry is destroyed */ |
62 | void (*destroy)(struct nf_conn *conntrack); | 52 | void (*destroy)(struct nf_conn *ct); |
63 | 53 | ||
64 | int (*error)(struct sk_buff *skb, unsigned int dataoff, | 54 | int (*error)(struct sk_buff *skb, unsigned int dataoff, |
65 | enum ip_conntrack_info *ctinfo, | 55 | enum ip_conntrack_info *ctinfo, |
66 | int pf, unsigned int hooknum); | 56 | int pf, unsigned int hooknum); |
67 | 57 | ||
58 | /* Print out the per-protocol part of the tuple. Return like seq_* */ | ||
59 | int (*print_tuple)(struct seq_file *s, | ||
60 | const struct nf_conntrack_tuple *); | ||
61 | |||
62 | /* Print out the private part of the conntrack. */ | ||
63 | int (*print_conntrack)(struct seq_file *s, const struct nf_conn *); | ||
64 | |||
68 | /* convert protoinfo to nfnetink attributes */ | 65 | /* convert protoinfo to nfnetink attributes */ |
69 | int (*to_nlattr)(struct sk_buff *skb, struct nlattr *nla, | 66 | int (*to_nlattr)(struct sk_buff *skb, struct nlattr *nla, |
70 | const struct nf_conn *ct); | 67 | const struct nf_conn *ct); |
@@ -87,6 +84,8 @@ struct nf_conntrack_l4proto | |||
87 | struct ctl_table *ctl_compat_table; | 84 | struct ctl_table *ctl_compat_table; |
88 | #endif | 85 | #endif |
89 | #endif | 86 | #endif |
87 | /* Protocol name */ | ||
88 | const char *name; | ||
90 | 89 | ||
91 | /* Module (if any) which this is connected to. */ | 90 | /* Module (if any) which this is connected to. */ |
92 | struct module *me; | 91 | struct module *me; |
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h index 45cb17cdcfd0..e69ab2e87597 100644 --- a/include/net/netfilter/nf_conntrack_tuple.h +++ b/include/net/netfilter/nf_conntrack_tuple.h | |||
@@ -132,34 +132,33 @@ struct nf_conntrack_tuple_hash | |||
132 | 132 | ||
133 | #endif /* __KERNEL__ */ | 133 | #endif /* __KERNEL__ */ |
134 | 134 | ||
135 | static inline int nf_ct_tuple_src_equal(const struct nf_conntrack_tuple *t1, | 135 | static inline int __nf_ct_tuple_src_equal(const struct nf_conntrack_tuple *t1, |
136 | const struct nf_conntrack_tuple *t2) | 136 | const struct nf_conntrack_tuple *t2) |
137 | { | 137 | { |
138 | return (t1->src.u3.all[0] == t2->src.u3.all[0] && | 138 | return (t1->src.u3.all[0] == t2->src.u3.all[0] && |
139 | t1->src.u3.all[1] == t2->src.u3.all[1] && | 139 | t1->src.u3.all[1] == t2->src.u3.all[1] && |
140 | t1->src.u3.all[2] == t2->src.u3.all[2] && | 140 | t1->src.u3.all[2] == t2->src.u3.all[2] && |
141 | t1->src.u3.all[3] == t2->src.u3.all[3] && | 141 | t1->src.u3.all[3] == t2->src.u3.all[3] && |
142 | t1->src.u.all == t2->src.u.all && | 142 | t1->src.u.all == t2->src.u.all && |
143 | t1->src.l3num == t2->src.l3num && | 143 | t1->src.l3num == t2->src.l3num); |
144 | t1->dst.protonum == t2->dst.protonum); | ||
145 | } | 144 | } |
146 | 145 | ||
147 | static inline int nf_ct_tuple_dst_equal(const struct nf_conntrack_tuple *t1, | 146 | static inline int __nf_ct_tuple_dst_equal(const struct nf_conntrack_tuple *t1, |
148 | const struct nf_conntrack_tuple *t2) | 147 | const struct nf_conntrack_tuple *t2) |
149 | { | 148 | { |
150 | return (t1->dst.u3.all[0] == t2->dst.u3.all[0] && | 149 | return (t1->dst.u3.all[0] == t2->dst.u3.all[0] && |
151 | t1->dst.u3.all[1] == t2->dst.u3.all[1] && | 150 | t1->dst.u3.all[1] == t2->dst.u3.all[1] && |
152 | t1->dst.u3.all[2] == t2->dst.u3.all[2] && | 151 | t1->dst.u3.all[2] == t2->dst.u3.all[2] && |
153 | t1->dst.u3.all[3] == t2->dst.u3.all[3] && | 152 | t1->dst.u3.all[3] == t2->dst.u3.all[3] && |
154 | t1->dst.u.all == t2->dst.u.all && | 153 | t1->dst.u.all == t2->dst.u.all && |
155 | t1->src.l3num == t2->src.l3num && | ||
156 | t1->dst.protonum == t2->dst.protonum); | 154 | t1->dst.protonum == t2->dst.protonum); |
157 | } | 155 | } |
158 | 156 | ||
159 | static inline int nf_ct_tuple_equal(const struct nf_conntrack_tuple *t1, | 157 | static inline int nf_ct_tuple_equal(const struct nf_conntrack_tuple *t1, |
160 | const struct nf_conntrack_tuple *t2) | 158 | const struct nf_conntrack_tuple *t2) |
161 | { | 159 | { |
162 | return nf_ct_tuple_src_equal(t1, t2) && nf_ct_tuple_dst_equal(t1, t2); | 160 | return __nf_ct_tuple_src_equal(t1, t2) && |
161 | __nf_ct_tuple_dst_equal(t1, t2); | ||
163 | } | 162 | } |
164 | 163 | ||
165 | static inline int nf_ct_tuple_mask_equal(const struct nf_conntrack_tuple_mask *m1, | 164 | static inline int nf_ct_tuple_mask_equal(const struct nf_conntrack_tuple_mask *m1, |
@@ -199,7 +198,7 @@ static inline int nf_ct_tuple_mask_cmp(const struct nf_conntrack_tuple *t, | |||
199 | const struct nf_conntrack_tuple_mask *mask) | 198 | const struct nf_conntrack_tuple_mask *mask) |
200 | { | 199 | { |
201 | return nf_ct_tuple_src_mask_cmp(t, tuple, mask) && | 200 | return nf_ct_tuple_src_mask_cmp(t, tuple, mask) && |
202 | nf_ct_tuple_dst_equal(t, tuple); | 201 | __nf_ct_tuple_dst_equal(t, tuple); |
203 | } | 202 | } |
204 | 203 | ||
205 | #endif /* _NF_CONNTRACK_TUPLE_H */ | 204 | #endif /* _NF_CONNTRACK_TUPLE_H */ |
diff --git a/include/net/netfilter/nf_log.h b/include/net/netfilter/nf_log.h index 037e82403f91..8c6b5ae45534 100644 --- a/include/net/netfilter/nf_log.h +++ b/include/net/netfilter/nf_log.h | |||
@@ -54,6 +54,6 @@ void nf_log_packet(int pf, | |||
54 | const struct net_device *in, | 54 | const struct net_device *in, |
55 | const struct net_device *out, | 55 | const struct net_device *out, |
56 | const struct nf_loginfo *li, | 56 | const struct nf_loginfo *li, |
57 | const char *fmt, ...); | 57 | const char *fmt, ...) __attribute__ ((format(printf,7,8))); |
58 | 58 | ||
59 | #endif /* _NF_LOG_H */ | 59 | #endif /* _NF_LOG_H */ |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 15a0b052df22..a9b4f6086294 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
@@ -27,5 +27,11 @@ struct netns_ipv4 { | |||
27 | struct sock *fibnl; | 27 | struct sock *fibnl; |
28 | 28 | ||
29 | struct netns_frags frags; | 29 | struct netns_frags frags; |
30 | #ifdef CONFIG_NETFILTER | ||
31 | struct xt_table *iptable_filter; | ||
32 | struct xt_table *iptable_mangle; | ||
33 | struct xt_table *iptable_raw; | ||
34 | struct xt_table *arptable_filter; | ||
35 | #endif | ||
30 | }; | 36 | }; |
31 | #endif | 37 | #endif |
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index 187c4248df22..1dd7de4e4195 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h | |||
@@ -31,5 +31,10 @@ struct netns_ipv6 { | |||
31 | struct ipv6_devconf *devconf_all; | 31 | struct ipv6_devconf *devconf_all; |
32 | struct ipv6_devconf *devconf_dflt; | 32 | struct ipv6_devconf *devconf_dflt; |
33 | struct netns_frags frags; | 33 | struct netns_frags frags; |
34 | #ifdef CONFIG_NETFILTER | ||
35 | struct xt_table *ip6table_filter; | ||
36 | struct xt_table *ip6table_mangle; | ||
37 | struct xt_table *ip6table_raw; | ||
38 | #endif | ||
34 | }; | 39 | }; |
35 | #endif | 40 | #endif |
diff --git a/include/net/netns/x_tables.h b/include/net/netns/x_tables.h new file mode 100644 index 000000000000..0cb63ed2c1fc --- /dev/null +++ b/include/net/netns/x_tables.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef __NETNS_X_TABLES_H | ||
2 | #define __NETNS_X_TABLES_H | ||
3 | |||
4 | #include <linux/list.h> | ||
5 | #include <linux/net.h> | ||
6 | |||
7 | struct netns_xt { | ||
8 | struct list_head tables[NPROTO]; | ||
9 | }; | ||
10 | #endif | ||
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index 8716eb757d51..d349c66ef828 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h | |||
@@ -131,14 +131,14 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts, | |||
131 | 131 | ||
132 | extern int tcf_exts_validate(struct tcf_proto *tp, struct nlattr **tb, | 132 | extern int tcf_exts_validate(struct tcf_proto *tp, struct nlattr **tb, |
133 | struct nlattr *rate_tlv, struct tcf_exts *exts, | 133 | struct nlattr *rate_tlv, struct tcf_exts *exts, |
134 | struct tcf_ext_map *map); | 134 | const struct tcf_ext_map *map); |
135 | extern void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts); | 135 | extern void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts); |
136 | extern void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, | 136 | extern void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, |
137 | struct tcf_exts *src); | 137 | struct tcf_exts *src); |
138 | extern int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts, | 138 | extern int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts, |
139 | struct tcf_ext_map *map); | 139 | const struct tcf_ext_map *map); |
140 | extern int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts, | 140 | extern int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts, |
141 | struct tcf_ext_map *map); | 141 | const struct tcf_ext_map *map); |
142 | 142 | ||
143 | /** | 143 | /** |
144 | * struct tcf_pkt_info - packet information | 144 | * struct tcf_pkt_info - packet information |
diff --git a/include/net/raw.h b/include/net/raw.h index cca81d8b2d8b..1828f81fe374 100644 --- a/include/net/raw.h +++ b/include/net/raw.h | |||
@@ -41,7 +41,6 @@ extern void raw_proc_exit(void); | |||
41 | struct raw_iter_state { | 41 | struct raw_iter_state { |
42 | struct seq_net_private p; | 42 | struct seq_net_private p; |
43 | int bucket; | 43 | int bucket; |
44 | unsigned short family; | ||
45 | struct raw_hashinfo *h; | 44 | struct raw_hashinfo *h; |
46 | }; | 45 | }; |
47 | 46 | ||
@@ -49,8 +48,8 @@ struct raw_iter_state { | |||
49 | void *raw_seq_start(struct seq_file *seq, loff_t *pos); | 48 | void *raw_seq_start(struct seq_file *seq, loff_t *pos); |
50 | void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos); | 49 | void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos); |
51 | void raw_seq_stop(struct seq_file *seq, void *v); | 50 | void raw_seq_stop(struct seq_file *seq, void *v); |
52 | int raw_seq_open(struct inode *ino, struct file *file, struct raw_hashinfo *h, | 51 | int raw_seq_open(struct inode *ino, struct file *file, |
53 | unsigned short family); | 52 | struct raw_hashinfo *h, const struct seq_operations *ops); |
54 | 53 | ||
55 | #endif | 54 | #endif |
56 | 55 | ||
diff --git a/include/net/route.h b/include/net/route.h index 4eabf008413b..eadad5901429 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <net/dst.h> | 27 | #include <net/dst.h> |
28 | #include <net/inetpeer.h> | 28 | #include <net/inetpeer.h> |
29 | #include <net/flow.h> | 29 | #include <net/flow.h> |
30 | #include <net/sock.h> | ||
30 | #include <linux/in_route.h> | 31 | #include <linux/in_route.h> |
31 | #include <linux/rtnetlink.h> | 32 | #include <linux/rtnetlink.h> |
32 | #include <linux/route.h> | 33 | #include <linux/route.h> |
@@ -61,6 +62,7 @@ struct rtable | |||
61 | 62 | ||
62 | struct in_device *idev; | 63 | struct in_device *idev; |
63 | 64 | ||
65 | int rt_genid; | ||
64 | unsigned rt_flags; | 66 | unsigned rt_flags; |
65 | __u16 rt_type; | 67 | __u16 rt_type; |
66 | 68 | ||
@@ -149,6 +151,7 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst, | |||
149 | int flags) | 151 | int flags) |
150 | { | 152 | { |
151 | struct flowi fl = { .oif = oif, | 153 | struct flowi fl = { .oif = oif, |
154 | .mark = sk->sk_mark, | ||
152 | .nl_u = { .ip4_u = { .daddr = dst, | 155 | .nl_u = { .ip4_u = { .daddr = dst, |
153 | .saddr = src, | 156 | .saddr = src, |
154 | .tos = tos } }, | 157 | .tos = tos } }, |
diff --git a/include/net/sock.h b/include/net/sock.h index 902324488d0f..e3fb4c047f4c 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -262,6 +262,8 @@ struct sock { | |||
262 | __u32 sk_sndmsg_off; | 262 | __u32 sk_sndmsg_off; |
263 | int sk_write_pending; | 263 | int sk_write_pending; |
264 | void *sk_security; | 264 | void *sk_security; |
265 | __u32 sk_mark; | ||
266 | /* XXX 4 bytes hole on 64 bit */ | ||
265 | void (*sk_state_change)(struct sock *sk); | 267 | void (*sk_state_change)(struct sock *sk); |
266 | void (*sk_data_ready)(struct sock *sk, int bytes); | 268 | void (*sk_data_ready)(struct sock *sk, int bytes); |
267 | void (*sk_write_space)(struct sock *sk); | 269 | void (*sk_write_space)(struct sock *sk); |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 5ebb9ba479b1..ac72116636ca 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -159,6 +159,7 @@ struct xfrm_state | |||
159 | struct xfrm_algo *aalg; | 159 | struct xfrm_algo *aalg; |
160 | struct xfrm_algo *ealg; | 160 | struct xfrm_algo *ealg; |
161 | struct xfrm_algo *calg; | 161 | struct xfrm_algo *calg; |
162 | struct xfrm_algo_aead *aead; | ||
162 | 163 | ||
163 | /* Data for encapsulator */ | 164 | /* Data for encapsulator */ |
164 | struct xfrm_encap_tmpl *encap; | 165 | struct xfrm_encap_tmpl *encap; |
@@ -201,7 +202,7 @@ struct xfrm_state | |||
201 | 202 | ||
202 | /* Reference to data common to all the instances of this | 203 | /* Reference to data common to all the instances of this |
203 | * transformer. */ | 204 | * transformer. */ |
204 | struct xfrm_type *type; | 205 | const struct xfrm_type *type; |
205 | struct xfrm_mode *inner_mode; | 206 | struct xfrm_mode *inner_mode; |
206 | struct xfrm_mode *outer_mode; | 207 | struct xfrm_mode *outer_mode; |
207 | 208 | ||
@@ -278,7 +279,7 @@ struct xfrm_state_afinfo { | |||
278 | unsigned int proto; | 279 | unsigned int proto; |
279 | unsigned int eth_proto; | 280 | unsigned int eth_proto; |
280 | struct module *owner; | 281 | struct module *owner; |
281 | struct xfrm_type *type_map[IPPROTO_MAX]; | 282 | const struct xfrm_type *type_map[IPPROTO_MAX]; |
282 | struct xfrm_mode *mode_map[XFRM_MODE_MAX]; | 283 | struct xfrm_mode *mode_map[XFRM_MODE_MAX]; |
283 | int (*init_flags)(struct xfrm_state *x); | 284 | int (*init_flags)(struct xfrm_state *x); |
284 | void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl, | 285 | void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl, |
@@ -321,8 +322,8 @@ struct xfrm_type | |||
321 | u32 (*get_mtu)(struct xfrm_state *, int size); | 322 | u32 (*get_mtu)(struct xfrm_state *, int size); |
322 | }; | 323 | }; |
323 | 324 | ||
324 | extern int xfrm_register_type(struct xfrm_type *type, unsigned short family); | 325 | extern int xfrm_register_type(const struct xfrm_type *type, unsigned short family); |
325 | extern int xfrm_unregister_type(struct xfrm_type *type, unsigned short family); | 326 | extern int xfrm_unregister_type(const struct xfrm_type *type, unsigned short family); |
326 | 327 | ||
327 | struct xfrm_mode { | 328 | struct xfrm_mode { |
328 | /* | 329 | /* |
@@ -1108,6 +1109,10 @@ static inline int xfrm_id_proto_match(u8 proto, u8 userproto) | |||
1108 | /* | 1109 | /* |
1109 | * xfrm algorithm information | 1110 | * xfrm algorithm information |
1110 | */ | 1111 | */ |
1112 | struct xfrm_algo_aead_info { | ||
1113 | u16 icv_truncbits; | ||
1114 | }; | ||
1115 | |||
1111 | struct xfrm_algo_auth_info { | 1116 | struct xfrm_algo_auth_info { |
1112 | u16 icv_truncbits; | 1117 | u16 icv_truncbits; |
1113 | u16 icv_fullbits; | 1118 | u16 icv_fullbits; |
@@ -1127,6 +1132,7 @@ struct xfrm_algo_desc { | |||
1127 | char *compat; | 1132 | char *compat; |
1128 | u8 available:1; | 1133 | u8 available:1; |
1129 | union { | 1134 | union { |
1135 | struct xfrm_algo_aead_info aead; | ||
1130 | struct xfrm_algo_auth_info auth; | 1136 | struct xfrm_algo_auth_info auth; |
1131 | struct xfrm_algo_encr_info encr; | 1137 | struct xfrm_algo_encr_info encr; |
1132 | struct xfrm_algo_comp_info comp; | 1138 | struct xfrm_algo_comp_info comp; |
@@ -1343,6 +1349,8 @@ extern struct xfrm_algo_desc *xfrm_calg_get_byid(int alg_id); | |||
1343 | extern struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name, int probe); | 1349 | extern struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name, int probe); |
1344 | extern struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name, int probe); | 1350 | extern struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name, int probe); |
1345 | extern struct xfrm_algo_desc *xfrm_calg_get_byname(char *name, int probe); | 1351 | extern struct xfrm_algo_desc *xfrm_calg_get_byname(char *name, int probe); |
1352 | extern struct xfrm_algo_desc *xfrm_aead_get_byname(char *name, int icv_len, | ||
1353 | int probe); | ||
1346 | 1354 | ||
1347 | struct hash_desc; | 1355 | struct hash_desc; |
1348 | struct scatterlist; | 1356 | struct scatterlist; |