diff options
author | David S. Miller <davem@davemloft.net> | 2011-08-08 02:20:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-08-08 02:20:26 -0400 |
commit | 19fd61785a580c60cba900c5171bfadb57dd5056 (patch) | |
tree | 1e491fb014be0dc03f4b6755bb94e73afd38c455 /include/net | |
parent | 57569d0e12eaf31717e295960cd2a26f626c8e5b (diff) | |
parent | 8028837d71ba9904b17281b40f94b93e947fbe38 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/cipso_ipv4.h | 2 | ||||
-rw-r--r-- | include/net/dst.h | 17 | ||||
-rw-r--r-- | include/net/inet_sock.h | 2 | ||||
-rw-r--r-- | include/net/netlabel.h | 2 | ||||
-rw-r--r-- | include/net/secure_seq.h | 20 |
5 files changed, 36 insertions, 7 deletions
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h index 3b938743514b..9808877c2ab9 100644 --- a/include/net/cipso_ipv4.h +++ b/include/net/cipso_ipv4.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * have chosen to adopt the protocol and over the years it has become a | 8 | * have chosen to adopt the protocol and over the years it has become a |
9 | * de-facto standard for labeled networking. | 9 | * de-facto standard for labeled networking. |
10 | * | 10 | * |
11 | * Author: Paul Moore <paul.moore@hp.com> | 11 | * Author: Paul Moore <paul@paul-moore.com> |
12 | * | 12 | * |
13 | */ | 13 | */ |
14 | 14 | ||
diff --git a/include/net/dst.h b/include/net/dst.h index 29e255796ce1..13d507d69ddb 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -37,7 +37,7 @@ struct dst_entry { | |||
37 | unsigned long _metrics; | 37 | unsigned long _metrics; |
38 | unsigned long expires; | 38 | unsigned long expires; |
39 | struct dst_entry *path; | 39 | struct dst_entry *path; |
40 | struct neighbour *_neighbour; | 40 | struct neighbour __rcu *_neighbour; |
41 | #ifdef CONFIG_XFRM | 41 | #ifdef CONFIG_XFRM |
42 | struct xfrm_state *xfrm; | 42 | struct xfrm_state *xfrm; |
43 | #else | 43 | #else |
@@ -88,12 +88,17 @@ struct dst_entry { | |||
88 | 88 | ||
89 | static inline struct neighbour *dst_get_neighbour(struct dst_entry *dst) | 89 | static inline struct neighbour *dst_get_neighbour(struct dst_entry *dst) |
90 | { | 90 | { |
91 | return dst->_neighbour; | 91 | return rcu_dereference(dst->_neighbour); |
92 | } | ||
93 | |||
94 | static inline struct neighbour *dst_get_neighbour_raw(struct dst_entry *dst) | ||
95 | { | ||
96 | return rcu_dereference_raw(dst->_neighbour); | ||
92 | } | 97 | } |
93 | 98 | ||
94 | static inline void dst_set_neighbour(struct dst_entry *dst, struct neighbour *neigh) | 99 | static inline void dst_set_neighbour(struct dst_entry *dst, struct neighbour *neigh) |
95 | { | 100 | { |
96 | dst->_neighbour = neigh; | 101 | rcu_assign_pointer(dst->_neighbour, neigh); |
97 | } | 102 | } |
98 | 103 | ||
99 | extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old); | 104 | extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old); |
@@ -382,8 +387,12 @@ static inline void dst_rcu_free(struct rcu_head *head) | |||
382 | static inline void dst_confirm(struct dst_entry *dst) | 387 | static inline void dst_confirm(struct dst_entry *dst) |
383 | { | 388 | { |
384 | if (dst) { | 389 | if (dst) { |
385 | struct neighbour *n = dst_get_neighbour(dst); | 390 | struct neighbour *n; |
391 | |||
392 | rcu_read_lock(); | ||
393 | n = dst_get_neighbour(dst); | ||
386 | neigh_confirm(n); | 394 | neigh_confirm(n); |
395 | rcu_read_unlock(); | ||
387 | } | 396 | } |
388 | } | 397 | } |
389 | 398 | ||
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index caaff5f5f39f..b897d6e6d0a5 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
@@ -238,7 +238,7 @@ static inline __u8 inet_sk_flowi_flags(const struct sock *sk) | |||
238 | { | 238 | { |
239 | __u8 flags = 0; | 239 | __u8 flags = 0; |
240 | 240 | ||
241 | if (inet_sk(sk)->transparent) | 241 | if (inet_sk(sk)->transparent || inet_sk(sk)->hdrincl) |
242 | flags |= FLOWI_FLAG_ANYSRC; | 242 | flags |= FLOWI_FLAG_ANYSRC; |
243 | if (sk->sk_protocol == IPPROTO_TCP) | 243 | if (sk->sk_protocol == IPPROTO_TCP) |
244 | flags |= FLOWI_FLAG_PRECOW_METRICS; | 244 | flags |= FLOWI_FLAG_PRECOW_METRICS; |
diff --git a/include/net/netlabel.h b/include/net/netlabel.h index f21a16ee3705..f67440970d7e 100644 --- a/include/net/netlabel.h +++ b/include/net/netlabel.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * The NetLabel system manages static and dynamic label mappings for network | 4 | * The NetLabel system manages static and dynamic label mappings for network |
5 | * protocols such as CIPSO and RIPSO. | 5 | * protocols such as CIPSO and RIPSO. |
6 | * | 6 | * |
7 | * Author: Paul Moore <paul.moore@hp.com> | 7 | * Author: Paul Moore <paul@paul-moore.com> |
8 | * | 8 | * |
9 | */ | 9 | */ |
10 | 10 | ||
diff --git a/include/net/secure_seq.h b/include/net/secure_seq.h new file mode 100644 index 000000000000..d97f6892c019 --- /dev/null +++ b/include/net/secure_seq.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef _NET_SECURE_SEQ | ||
2 | #define _NET_SECURE_SEQ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | extern __u32 secure_ip_id(__be32 daddr); | ||
7 | extern __u32 secure_ipv6_id(const __be32 daddr[4]); | ||
8 | extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); | ||
9 | extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, | ||
10 | __be16 dport); | ||
11 | extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, | ||
12 | __be16 sport, __be16 dport); | ||
13 | extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr, | ||
14 | __be16 sport, __be16 dport); | ||
15 | extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, | ||
16 | __be16 sport, __be16 dport); | ||
17 | extern u64 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr, | ||
18 | __be16 sport, __be16 dport); | ||
19 | |||
20 | #endif /* _NET_SECURE_SEQ */ | ||