Return EADDRNOTAVAIL instead of EDESTADDRREQ error when listen(2)
is called on improperly bound socket.
This commit is contained in:
emax 2007-08-28 17:07:49 +00:00
parent 99ff582459
commit d0e06d1dd8
2 changed files with 2 additions and 2 deletions

View File

@ -2424,7 +2424,7 @@ ng_btsocket_l2cap_listen(struct socket *so, struct thread *td)
goto out;
}
if (pcb->psm == 0) {
error = EDESTADDRREQ;
error = EADDRNOTAVAIL;
goto out;
}
solisten_proto(so);

View File

@ -805,7 +805,7 @@ ng_btsocket_rfcomm_listen(struct socket *so, struct thread *td)
if (pcb == NULL)
return (EINVAL);
if (pcb->channel < 1 || pcb->channel > 30)
return (EDESTADDRREQ);
return (EADDRNOTAVAIL);
/*
* XXX FIXME - This is FUBAR. socreate() will call soalloc(1), i.e.