diff options
Diffstat (limited to 'include/net/inet_timewait_sock.h')
-rw-r--r-- | include/net/inet_timewait_sock.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index f93ad90a601b..b801ade2295e 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
@@ -194,11 +194,13 @@ static inline struct inet_timewait_sock *inet_twsk(const struct sock *sk) | |||
194 | static inline __be32 inet_rcv_saddr(const struct sock *sk) | 194 | static inline __be32 inet_rcv_saddr(const struct sock *sk) |
195 | { | 195 | { |
196 | return likely(sk->sk_state != TCP_TIME_WAIT) ? | 196 | return likely(sk->sk_state != TCP_TIME_WAIT) ? |
197 | inet_sk(sk)->rcv_saddr : inet_twsk(sk)->tw_rcv_saddr; | 197 | inet_sk(sk)->inet_rcv_saddr : inet_twsk(sk)->tw_rcv_saddr; |
198 | } | 198 | } |
199 | 199 | ||
200 | extern void inet_twsk_put(struct inet_timewait_sock *tw); | 200 | extern void inet_twsk_put(struct inet_timewait_sock *tw); |
201 | 201 | ||
202 | extern int inet_twsk_unhash(struct inet_timewait_sock *tw); | ||
203 | |||
202 | extern struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, | 204 | extern struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, |
203 | const int state); | 205 | const int state); |
204 | 206 | ||
@@ -212,14 +214,14 @@ extern void inet_twsk_schedule(struct inet_timewait_sock *tw, | |||
212 | extern void inet_twsk_deschedule(struct inet_timewait_sock *tw, | 214 | extern void inet_twsk_deschedule(struct inet_timewait_sock *tw, |
213 | struct inet_timewait_death_row *twdr); | 215 | struct inet_timewait_death_row *twdr); |
214 | 216 | ||
215 | extern void inet_twsk_purge(struct net *net, struct inet_hashinfo *hashinfo, | 217 | extern void inet_twsk_purge(struct inet_hashinfo *hashinfo, |
216 | struct inet_timewait_death_row *twdr, int family); | 218 | struct inet_timewait_death_row *twdr, int family); |
217 | 219 | ||
218 | static inline | 220 | static inline |
219 | struct net *twsk_net(const struct inet_timewait_sock *twsk) | 221 | struct net *twsk_net(const struct inet_timewait_sock *twsk) |
220 | { | 222 | { |
221 | #ifdef CONFIG_NET_NS | 223 | #ifdef CONFIG_NET_NS |
222 | return twsk->tw_net; | 224 | return rcu_dereference(twsk->tw_net); |
223 | #else | 225 | #else |
224 | return &init_net; | 226 | return &init_net; |
225 | #endif | 227 | #endif |
@@ -229,7 +231,7 @@ static inline | |||
229 | void twsk_net_set(struct inet_timewait_sock *twsk, struct net *net) | 231 | void twsk_net_set(struct inet_timewait_sock *twsk, struct net *net) |
230 | { | 232 | { |
231 | #ifdef CONFIG_NET_NS | 233 | #ifdef CONFIG_NET_NS |
232 | twsk->tw_net = net; | 234 | rcu_assign_pointer(twsk->tw_net, net); |
233 | #endif | 235 | #endif |
234 | } | 236 | } |
235 | #endif /* _INET_TIMEWAIT_SOCK_ */ | 237 | #endif /* _INET_TIMEWAIT_SOCK_ */ |