extern int sysctl_max_syn_backlog;
-/** struct tcp_listen_opt - listen state
+/** struct listen_sock - listen state
*
* @max_qlen_log - log_2 of maximal queued SYNs/REQUESTs
*/
-struct tcp_listen_opt {
+struct listen_sock {
u8 max_qlen_log;
/* 3 bytes hole, try to use */
int qlen;
struct request_sock *rskq_accept_head;
struct request_sock *rskq_accept_tail;
rwlock_t syn_wait_lock;
- struct tcp_listen_opt *listen_opt;
+ struct listen_sock *listen_opt;
};
extern int reqsk_queue_alloc(struct request_sock_queue *queue,
const int nr_table_entries);
-static inline struct tcp_listen_opt *reqsk_queue_yank_listen_sk(struct request_sock_queue *queue)
+static inline struct listen_sock *reqsk_queue_yank_listen_sk(struct request_sock_queue *queue)
{
- struct tcp_listen_opt *lopt;
+ struct listen_sock *lopt;
write_lock_bh(&queue->syn_wait_lock);
lopt = queue->listen_opt;
static inline int reqsk_queue_removed(struct request_sock_queue *queue,
struct request_sock *req)
{
- struct tcp_listen_opt *lopt = queue->listen_opt;
+ struct listen_sock *lopt = queue->listen_opt;
if (req->retrans == 0)
--lopt->qlen_young;
static inline int reqsk_queue_added(struct request_sock_queue *queue)
{
- struct tcp_listen_opt *lopt = queue->listen_opt;
+ struct listen_sock *lopt = queue->listen_opt;
const int prev_qlen = lopt->qlen;
lopt->qlen_young++;
u32 hash, struct request_sock *req,
unsigned timeout)
{
- struct tcp_listen_opt *lopt = queue->listen_opt;
+ struct listen_sock *lopt = queue->listen_opt;
req->expires = jiffies + timeout;
req->retrans = 0;
int reqsk_queue_alloc(struct request_sock_queue *queue,
const int nr_table_entries)
{
- const int lopt_size = sizeof(struct tcp_listen_opt) +
+ const int lopt_size = sizeof(struct listen_sock) +
nr_table_entries * sizeof(struct request_sock *);
- struct tcp_listen_opt *lopt = kmalloc(lopt_size, GFP_KERNEL);
+ struct listen_sock *lopt = kmalloc(lopt_size, GFP_KERNEL);
if (lopt == NULL)
return -ENOMEM;
static void tcp_listen_stop (struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
- struct tcp_listen_opt *lopt;
+ struct listen_sock *lopt;
struct request_sock *acc_req;
struct request_sock *req;
int i;
struct tcpdiag_entry entry;
struct tcpdiagreq *r = NLMSG_DATA(cb->nlh);
struct tcp_sock *tp = tcp_sk(sk);
- struct tcp_listen_opt *lopt;
+ struct listen_sock *lopt;
struct rtattr *bc = NULL;
struct inet_sock *inet = inet_sk(sk);
int j, s_j;
__u16 rport,
__u32 raddr, __u32 laddr)
{
- struct tcp_listen_opt *lopt = tp->accept_queue.listen_opt;
+ struct listen_sock *lopt = tp->accept_queue.listen_opt;
struct request_sock *req, **prev;
for (prev = &lopt->syn_table[tcp_v4_synq_hash(raddr, rport, lopt->hash_rnd)];
static void tcp_v4_synq_add(struct sock *sk, struct request_sock *req)
{
struct tcp_sock *tp = tcp_sk(sk);
- struct tcp_listen_opt *lopt = tp->accept_queue.listen_opt;
+ struct listen_sock *lopt = tp->accept_queue.listen_opt;
u32 h = tcp_v4_synq_hash(inet_rsk(req)->rmt_addr, inet_rsk(req)->rmt_port, lopt->hash_rnd);
reqsk_queue_hash_req(&tp->accept_queue, h, req, TCP_TIMEOUT_INIT);
static void tcp_synack_timer(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
- struct tcp_listen_opt *lopt = tp->accept_queue.listen_opt;
+ struct listen_sock *lopt = tp->accept_queue.listen_opt;
int max_retries = tp->syn_retries ? : sysctl_tcp_synack_retries;
int thresh = max_retries;
unsigned long now = jiffies;
struct in6_addr *laddr,
int iif)
{
- struct tcp_listen_opt *lopt = tp->accept_queue.listen_opt;
+ struct listen_sock *lopt = tp->accept_queue.listen_opt;
struct request_sock *req, **prev;
for (prev = &lopt->syn_table[tcp_v6_synq_hash(raddr, rport, lopt->hash_rnd)];
static void tcp_v6_synq_add(struct sock *sk, struct request_sock *req)
{
struct tcp_sock *tp = tcp_sk(sk);
- struct tcp_listen_opt *lopt = tp->accept_queue.listen_opt;
+ struct listen_sock *lopt = tp->accept_queue.listen_opt;
u32 h = tcp_v6_synq_hash(&tcp6_rsk(req)->rmt_addr, inet_rsk(req)->rmt_port, lopt->hash_rnd);
reqsk_queue_hash_req(&tp->accept_queue, h, req, TCP_TIMEOUT_INIT);