summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorChas Williams <chas@cmf.nrl.navy.mil>2005-09-28 16:35:01 -0700
committerDavid S. Miller <davem@davemloft.net>2005-09-28 16:35:01 -0700
commit9301e320e98ff19a0e48881b038d0c24ca76e6c0 (patch)
treeb625aa1cb6dab99f343cdf85e0f32e7838a7ad93 /net
parente2c4b72158a9f1286df41dee478e774f1b94e93a (diff)
downloadop-kernel-dev-9301e320e98ff19a0e48881b038d0c24ca76e6c0.zip
op-kernel-dev-9301e320e98ff19a0e48881b038d0c24ca76e6c0.tar.gz
[ATM]: track and close listen sockets when sigd exits
Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>
Diffstat (limited to 'net')
-rw-r--r--net/atm/common.c4
-rw-r--r--net/atm/signaling.c8
-rw-r--r--net/atm/svc.c1
3 files changed, 7 insertions, 6 deletions
diff --git a/net/atm/common.c b/net/atm/common.c
index e93e838..801a581 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -178,8 +178,6 @@ static void vcc_destroy_socket(struct sock *sk)
if (vcc->push)
vcc->push(vcc, NULL); /* atmarpd has no push */
- vcc_remove_socket(sk); /* no more receive */
-
while ((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) {
atm_return(vcc,skb->truesize);
kfree_skb(skb);
@@ -188,6 +186,8 @@ static void vcc_destroy_socket(struct sock *sk)
module_put(vcc->dev->ops->owner);
atm_dev_put(vcc->dev);
}
+
+ vcc_remove_socket(sk);
}
diff --git a/net/atm/signaling.c b/net/atm/signaling.c
index f7c449a..e7211a7 100644
--- a/net/atm/signaling.c
+++ b/net/atm/signaling.c
@@ -217,8 +217,9 @@ void sigd_enq(struct atm_vcc *vcc,enum atmsvc_msg_type type,
static void purge_vcc(struct atm_vcc *vcc)
{
if (sk_atm(vcc)->sk_family == PF_ATMSVC &&
- !test_bit(ATM_VF_META,&vcc->flags)) {
- set_bit(ATM_VF_RELEASED,&vcc->flags);
+ !test_bit(ATM_VF_META, &vcc->flags)) {
+ set_bit(ATM_VF_RELEASED, &vcc->flags);
+ clear_bit(ATM_VF_REGIS, &vcc->flags);
vcc_release_async(vcc, -EUNATCH);
}
}
@@ -243,8 +244,7 @@ static void sigd_close(struct atm_vcc *vcc)
sk_for_each(s, node, head) {
struct atm_vcc *vcc = atm_sk(s);
- if (vcc->dev)
- purge_vcc(vcc);
+ purge_vcc(vcc);
}
}
read_unlock(&vcc_sklist_lock);
diff --git a/net/atm/svc.c b/net/atm/svc.c
index 08e4605..d7b2661 100644
--- a/net/atm/svc.c
+++ b/net/atm/svc.c
@@ -302,6 +302,7 @@ static int svc_listen(struct socket *sock,int backlog)
error = -EINVAL;
goto out;
}
+ vcc_insert_socket(sk);
set_bit(ATM_VF_WAITING, &vcc->flags);
prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
sigd_enq(vcc,as_listen,NULL,NULL,&vcc->local);
OpenPOWER on IntegriCloud