aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/inet_timewait_sock.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/inet_timewait_sock.h')
-rw-r--r--include/net/inet_timewait_sock.h18
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..07fe0d1a4f03 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);
208extern void inet_twsk_deschedule(struct inet_timewait_sock *tw, 208extern void inet_twsk_deschedule(struct inet_timewait_sock *tw,
209 struct inet_timewait_death_row *twdr); 209 struct inet_timewait_death_row *twdr);
210
211static inline
212struct 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
221static inline
222void twsk_net_set(struct inet_timewait_sock *twsk, const 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_ */