aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/mISDN/socket.c
diff options
context:
space:
mode:
authorAndreas Eversberg <andreas@eversberg.eu>2008-09-14 06:30:18 -0400
committerKarsten Keil <kkeil@suse.de>2009-01-09 16:44:27 -0500
commit1b4d33121f1d991f6ae226cc3333428ff87627bb (patch)
tree48fef7c8a422087a15a03c025b7709a100498a5a /drivers/isdn/mISDN/socket.c
parent02282eee56b75a35e6bbc42cc34c9005eb1653f4 (diff)
mISDN: Fix deactivation, if peer IP is removed from l1oip instance.
Added GETPEER operation. Socket now checks if device is already busy at a differen mode. Signed-off-by: Andreas Eversberg <andreas@eversberg.eu> Signed-off-by: Karsten Keil <kkeil@suse.de>
Diffstat (limited to 'drivers/isdn/mISDN/socket.c')
-rw-r--r--drivers/isdn/mISDN/socket.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
index 2f6d6e88ff2c..916569ca156d 100644
--- a/drivers/isdn/mISDN/socket.c
+++ b/drivers/isdn/mISDN/socket.c
@@ -460,6 +460,8 @@ data_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
460{ 460{
461 struct sockaddr_mISDN *maddr = (struct sockaddr_mISDN *) addr; 461 struct sockaddr_mISDN *maddr = (struct sockaddr_mISDN *) addr;
462 struct sock *sk = sock->sk; 462 struct sock *sk = sock->sk;
463 struct hlist_node *node;
464 struct sock *csk;
463 int err = 0; 465 int err = 0;
464 466
465 if (*debug & DEBUG_SOCKET) 467 if (*debug & DEBUG_SOCKET)
@@ -480,6 +482,24 @@ data_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
480 err = -ENODEV; 482 err = -ENODEV;
481 goto done; 483 goto done;
482 } 484 }
485
486 read_lock_bh(&data_sockets.lock);
487 sk_for_each(csk, node, &data_sockets.head) {
488 if (sk == csk)
489 continue;
490 if (_pms(csk)->dev != _pms(sk)->dev)
491 continue;
492 if (csk->sk_protocol >= ISDN_P_B_START)
493 continue;
494 if (IS_ISDN_P_TE(csk->sk_protocol)
495 == IS_ISDN_P_TE(sk->sk_protocol))
496 continue;
497 read_unlock_bh(&data_sockets.lock);
498 err = -EBUSY;
499 goto done;
500 }
501 read_unlock_bh(&data_sockets.lock);
502
483 _pms(sk)->ch.send = mISDN_send; 503 _pms(sk)->ch.send = mISDN_send;
484 _pms(sk)->ch.ctrl = mISDN_ctrl; 504 _pms(sk)->ch.ctrl = mISDN_ctrl;
485 505