diff options
Diffstat (limited to 'include/net/inet_timewait_sock.h')
-rw-r--r-- | include/net/inet_timewait_sock.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index 296547bfb0b7..95c660c9719b 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
@@ -207,4 +207,22 @@ extern void inet_twsk_schedule(struct inet_timewait_sock *tw, | |||
207 | const int timeo, const int timewait_len); | 207 | const int timeo, const int timewait_len); |
208 | extern void inet_twsk_deschedule(struct inet_timewait_sock *tw, | 208 | extern void inet_twsk_deschedule(struct inet_timewait_sock *tw, |
209 | struct inet_timewait_death_row *twdr); | 209 | struct inet_timewait_death_row *twdr); |
210 | |||
211 | static inline | ||
212 | struct net *twsk_net(const struct inet_timewait_sock *twsk) | ||
213 | { | ||
214 | #ifdef CONFIG_NET_NS | ||
215 | return twsk->tw_net; | ||
216 | #else | ||
217 | return &init_net; | ||
218 | #endif | ||
219 | } | ||
220 | |||
221 | static inline | ||
222 | void twsk_net_set(struct inet_timewait_sock *twsk, struct net *net) | ||
223 | { | ||
224 | #ifdef CONFIG_NET_NS | ||
225 | twsk->tw_net = net; | ||
226 | #endif | ||
227 | } | ||
210 | #endif /* _INET_TIMEWAIT_SOCK_ */ | 228 | #endif /* _INET_TIMEWAIT_SOCK_ */ |