phonet/pep: refuse to enable an unbound pipe
[linux-2.6-block.git] / net / phonet / pep.c
index b4f90afb0638b7e6b2f7668cfe2498f35625f79c..65d463ad87707782a44152014fa760798554145f 100644 (file)
@@ -947,6 +947,8 @@ static int pep_ioctl(struct sock *sk, int cmd, unsigned long arg)
                        ret =  -EBUSY;
                else if (sk->sk_state == TCP_ESTABLISHED)
                        ret = -EISCONN;
+               else if (!pn->pn_sk.sobject)
+                       ret = -EADDRNOTAVAIL;
                else
                        ret = pep_sock_enable(sk, NULL, 0);
                release_sock(sk);