aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/request_sock.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-03-16 00:12:16 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-16 15:55:29 -0400
commit13854e5a60461daee08ce99842b7f4d37553d911 (patch)
treef7bf7650ead7d8af1e93d98114da5cd1bf658956 /net/core/request_sock.c
parent2c13270b441054a9596bcd99c0f446603c9ad131 (diff)
inet: add proper refcounting to request sock
reqsk_put() is the generic function that should be used to release a refcount (and automatically call reqsk_free()) reqsk_free() might be called if refcount is known to be 0 or undefined. refcnt is set to one in inet_csk_reqsk_queue_add() As request socks are not yet in global ehash table, I added temporary debugging checks in reqsk_put() and reqsk_free() Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/request_sock.c')
-rw-r--r--net/core/request_sock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/request_sock.c b/net/core/request_sock.c
index 04db318e6218..e910317ef6d9 100644
--- a/net/core/request_sock.c
+++ b/net/core/request_sock.c
@@ -103,7 +103,7 @@ void reqsk_queue_destroy(struct request_sock_queue *queue)
103 while ((req = lopt->syn_table[i]) != NULL) { 103 while ((req = lopt->syn_table[i]) != NULL) {
104 lopt->syn_table[i] = req->dl_next; 104 lopt->syn_table[i] = req->dl_next;
105 lopt->qlen--; 105 lopt->qlen--;
106 reqsk_free(req); 106 reqsk_put(req);
107 } 107 }
108 } 108 }
109 } 109 }
@@ -180,7 +180,7 @@ void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req,
180 */ 180 */
181 spin_unlock_bh(&fastopenq->lock); 181 spin_unlock_bh(&fastopenq->lock);
182 sock_put(lsk); 182 sock_put(lsk);
183 reqsk_free(req); 183 reqsk_put(req);
184 return; 184 return;
185 } 185 }
186 /* Wait for 60secs before removing a req that has triggered RST. 186 /* Wait for 60secs before removing a req that has triggered RST.