1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-05 12:56:08 +00:00

Return EADDRNOTAVAIL instead of EDESTADDRREQ error when

listen(2) is called on improperly bound socket.

Suggested by:	Iain Hibbert
Approved by:	re (kensmith)
MFC after:	3 days
This commit is contained in:
Maksim Yevmenkin 2007-08-23 16:55:22 +00:00
parent fada2376b8
commit d46210e60d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=171937
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -805,7 +805,7 @@ ng_btsocket_rfcomm_listen(struct socket *so, int backlog, 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.