diff options
Diffstat (limited to 'include/net/inet_timewait_sock.h')
-rw-r--r-- | include/net/inet_timewait_sock.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index 3b070352e869..28f7b2103505 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
@@ -19,6 +19,7 @@ | |||
19 | 19 | ||
20 | #include <linux/ip.h> | 20 | #include <linux/ip.h> |
21 | #include <linux/list.h> | 21 | #include <linux/list.h> |
22 | #include <linux/module.h> | ||
22 | #include <linux/timer.h> | 23 | #include <linux/timer.h> |
23 | #include <linux/types.h> | 24 | #include <linux/types.h> |
24 | #include <linux/workqueue.h> | 25 | #include <linux/workqueue.h> |
@@ -112,6 +113,7 @@ struct inet_timewait_sock { | |||
112 | #define tw_node __tw_common.skc_node | 113 | #define tw_node __tw_common.skc_node |
113 | #define tw_bind_node __tw_common.skc_bind_node | 114 | #define tw_bind_node __tw_common.skc_bind_node |
114 | #define tw_refcnt __tw_common.skc_refcnt | 115 | #define tw_refcnt __tw_common.skc_refcnt |
116 | #define tw_hash __tw_common.skc_hash | ||
115 | #define tw_prot __tw_common.skc_prot | 117 | #define tw_prot __tw_common.skc_prot |
116 | volatile unsigned char tw_substate; | 118 | volatile unsigned char tw_substate; |
117 | /* 3 bits hole, try to pack */ | 119 | /* 3 bits hole, try to pack */ |
@@ -126,7 +128,6 @@ struct inet_timewait_sock { | |||
126 | /* And these are ours. */ | 128 | /* And these are ours. */ |
127 | __u8 tw_ipv6only:1; | 129 | __u8 tw_ipv6only:1; |
128 | /* 31 bits hole, try to pack */ | 130 | /* 31 bits hole, try to pack */ |
129 | int tw_hashent; | ||
130 | int tw_timeout; | 131 | int tw_timeout; |
131 | unsigned long tw_ttd; | 132 | unsigned long tw_ttd; |
132 | struct inet_bind_bucket *tw_tb; | 133 | struct inet_bind_bucket *tw_tb; |
@@ -193,11 +194,13 @@ static inline u32 inet_rcv_saddr(const struct sock *sk) | |||
193 | static inline void inet_twsk_put(struct inet_timewait_sock *tw) | 194 | static inline void inet_twsk_put(struct inet_timewait_sock *tw) |
194 | { | 195 | { |
195 | if (atomic_dec_and_test(&tw->tw_refcnt)) { | 196 | if (atomic_dec_and_test(&tw->tw_refcnt)) { |
197 | struct module *owner = tw->tw_prot->owner; | ||
196 | #ifdef SOCK_REFCNT_DEBUG | 198 | #ifdef SOCK_REFCNT_DEBUG |
197 | printk(KERN_DEBUG "%s timewait_sock %p released\n", | 199 | printk(KERN_DEBUG "%s timewait_sock %p released\n", |
198 | tw->tw_prot->name, tw); | 200 | tw->tw_prot->name, tw); |
199 | #endif | 201 | #endif |
200 | kmem_cache_free(tw->tw_prot->twsk_slab, tw); | 202 | kmem_cache_free(tw->tw_prot->twsk_slab, tw); |
203 | module_put(owner); | ||
201 | } | 204 | } |
202 | } | 205 | } |
203 | 206 | ||