diff options
author | Arnaldo Carvalho de Melo <acme@ghostprotocols.net> | 2005-10-11 00:25:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-10-11 00:25:23 -0400 |
commit | eeb2b8560676e454ad37ee30b49bc7d897edc9be (patch) | |
tree | 60b316e93b880aa1ba01a9c5496c8269a48b4de9 /net/ipv4/inet_timewait_sock.c | |
parent | 2a9bc9bb4d3a4570a8a48aadf071b91e657adb89 (diff) |
[TWSK]: Grab the module refcount for timewait sockets
This is required to avoid unloading a module that has active timewait
sockets, such as DCCP.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/inet_timewait_sock.c')
-rw-r--r-- | net/ipv4/inet_timewait_sock.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index f9076ef3a1a8..a010e9a68811 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c | |||
@@ -111,6 +111,7 @@ struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, const int stat | |||
111 | tw->tw_prot = sk->sk_prot_creator; | 111 | tw->tw_prot = sk->sk_prot_creator; |
112 | atomic_set(&tw->tw_refcnt, 1); | 112 | atomic_set(&tw->tw_refcnt, 1); |
113 | inet_twsk_dead_node_init(tw); | 113 | inet_twsk_dead_node_init(tw); |
114 | __module_get(tw->tw_prot->owner); | ||
114 | } | 115 | } |
115 | 116 | ||
116 | return tw; | 117 | return tw; |