How to close a sock?
Hi,
I've posted some days ago about a problem with a lkm.
I'm trying to close all the sock that remain too much time in SYN_RECV state.
This is how I obtain a pointer to each of them:
tcp_listen_lock();
for(i = 0; i < TCP_LHTABLE_SIZE; i++)
{
sk_copy = tcp_listening_hash[i];
while(sk_copy != NULL)
{
tp = &(sk_copy->tp_pinfo.af_tcp);
read_lock_bh(&tp->syn_wait_lock);
lopt = tp->listen_opt;
if (lopt && lopt->qlen != 0)
{
for (k=0; k<TCP_SYNQ_HSIZE; k++)
{
req = lopt->syn_table[k];
while(req != NULL)
{
req = req->dl_next;
// here I want to use tcp_synq_drop...but my system crashes!!!
num++;
}
}
}
read_unlock_bh(&tp->syn_wait_lock);
num++;
sk_copy = sk_copy->next;
}
}
tcp_listen_unlock();
How can I do it?
Thanx
damiano