| version 1.160, 2008/04/24 11:38:36 |
version 1.160.2.1, 2008/05/16 02:25:28 |
|
|
| * 2. Redistributions in binary form must reproduce the above copyright |
* 2. Redistributions in binary form must reproduce the above copyright |
| * notice, this list of conditions and the following disclaimer in the |
* notice, this list of conditions and the following disclaimer in the |
| * documentation and/or other materials provided with the distribution. |
* documentation and/or other materials provided with the distribution. |
| * 3. All advertising materials mentioning features or use of this software |
|
| * must display the following acknowledgement: |
|
| * This product includes software developed by the NetBSD |
|
| * Foundation, Inc. and its contributors. |
|
| * 4. Neither the name of The NetBSD Foundation nor the names of its |
|
| * contributors may be used to endorse or promote products derived |
|
| * from this software without specific prior written permission. |
|
| * |
* |
| * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
| * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
| Line 574 solisten(struct socket *so, int backlog, |
|
| Line 567 solisten(struct socket *so, int backlog, |
|
| |
|
| solock(so); |
solock(so); |
| if ((so->so_state & (SS_ISCONNECTED | SS_ISCONNECTING | |
if ((so->so_state & (SS_ISCONNECTED | SS_ISCONNECTING | |
| SS_ISDISCONNECTING)) != 0) |
SS_ISDISCONNECTING)) != 0) { |
| |
sounlock(so); |
| return (EOPNOTSUPP); |
return (EOPNOTSUPP); |
| |
} |
| error = (*so->so_proto->pr_usrreq)(so, PRU_LISTEN, NULL, |
error = (*so->so_proto->pr_usrreq)(so, PRU_LISTEN, NULL, |
| NULL, NULL, l); |
NULL, NULL, l); |
| if (error != 0) { |
if (error != 0) { |
| Line 594 solisten(struct socket *so, int backlog, |
|
| Line 589 solisten(struct socket *so, int backlog, |
|
| void |
void |
| sofree(struct socket *so) |
sofree(struct socket *so) |
| { |
{ |
| |
u_int refs; |
| |
|
| KASSERT(solocked(so)); |
KASSERT(solocked(so)); |
| |
|
| Line 623 sofree(struct socket *so) |
|
| Line 619 sofree(struct socket *so) |
|
| KASSERT(!cv_has_waiters(&so->so_rcv.sb_cv)); |
KASSERT(!cv_has_waiters(&so->so_rcv.sb_cv)); |
| KASSERT(!cv_has_waiters(&so->so_snd.sb_cv)); |
KASSERT(!cv_has_waiters(&so->so_snd.sb_cv)); |
| sorflush(so); |
sorflush(so); |
| |
refs = so->so_aborting; /* XXX */ |
| sounlock(so); |
sounlock(so); |
| soput(so); |
if (refs == 0) /* XXX */ |
| |
soput(so); |
| } |
} |
| |
|
| /* |
/* |
| Line 700 soclose(struct socket *so) |
|
| Line 698 soclose(struct socket *so) |
|
| int |
int |
| soabort(struct socket *so) |
soabort(struct socket *so) |
| { |
{ |
| |
u_int refs; |
| int error; |
int error; |
| |
|
| KASSERT(solocked(so)); |
KASSERT(solocked(so)); |
| KASSERT(so->so_head == NULL); |
KASSERT(so->so_head == NULL); |
| |
|
| |
so->so_aborting++; /* XXX */ |
| error = (*so->so_proto->pr_usrreq)(so, PRU_ABORT, NULL, |
error = (*so->so_proto->pr_usrreq)(so, PRU_ABORT, NULL, |
| NULL, NULL, NULL); |
NULL, NULL, NULL); |
| if (error) { |
refs = --so->so_aborting; /* XXX */ |
| |
if (error || (refs == 0)) { |
| sofree(so); |
sofree(so); |
| } else { |
} else { |
| sounlock(so); |
sounlock(so); |