| version 1.44.6.1, 1999/06/28 06:36:53 |
version 1.44.6.2, 1999/07/06 11:02:39 |
|
|
| register struct socket *so; |
register struct socket *so; |
| { |
{ |
| |
|
| if (so->so_pcb |
if (so->so_pcb || (so->so_state & SS_NOFDREF) == 0) |
| #ifdef MAPPED_ADDR_ENABLED |
|
| /* |
|
| * MAPPED_ADDR implementation spec: |
|
| * Check so_pcb2 despite the ip6_mapped_addr value. |
|
| * Because the sysctl value may be changed to 0 |
|
| * after connection establishment. |
|
| */ |
|
| || so->so_pcb2 |
|
| #endif /* MAPPED_ADDR_ENABLED */ |
|
| || (so->so_state & SS_NOFDREF) == 0) |
|
| return; |
return; |
| if (so->so_head) { |
if (so->so_head) { |
| /* |
/* |
|
|
| (void) soabort(so2); |
(void) soabort(so2); |
| } |
} |
| } |
} |
| if (so->so_pcb == 0 |
if (so->so_pcb == 0) |
| #ifdef MAPPED_ADDR_ENABLED |
|
| && so->so_pcb2 == 0 |
|
| #endif /* MAPPED_ADDR_ENABLED */ |
|
| ) |
|
| goto discard; |
goto discard; |
| if (so->so_state & SS_ISCONNECTED) { |
if (so->so_state & SS_ISCONNECTED) { |
| if ((so->so_state & SS_ISDISCONNECTING) == 0) { |
if ((so->so_state & SS_ISDISCONNECTING) == 0) { |
|
|
| } |
} |
| } |
} |
| drop: |
drop: |
| if (so->so_pcb |
if (so->so_pcb) { |
| #ifdef MAPPED_ADDR_ENABLED |
|
| || so->so_pcb2 |
|
| #endif /* MAPPED_ADDR_ENABLED */ |
|
| ) { |
|
| int error2 = (*so->so_proto->pr_usrreq)(so, PRU_DETACH, |
int error2 = (*so->so_proto->pr_usrreq)(so, PRU_DETACH, |
| (struct mbuf *)0, (struct mbuf *)0, (struct mbuf *)0, |
(struct mbuf *)0, (struct mbuf *)0, (struct mbuf *)0, |
| (struct proc *)0); |
(struct proc *)0); |
|
|
| if ((flags & MSG_PEEK) == 0) { |
if ((flags & MSG_PEEK) == 0) { |
| if (m == 0) |
if (m == 0) |
| so->so_rcv.sb_mb = nextrecord; |
so->so_rcv.sb_mb = nextrecord; |
| if (pr->pr_flags & PR_WANTRCVD && |
if (pr->pr_flags & PR_WANTRCVD && so->so_pcb) |
| (so->so_pcb |
|
| #ifdef MAPPED_ADDR_ENABLED |
|
| || so->so_pcb2 |
|
| #endif /* MAPPED_ADDR_ENABLED */ |
|
| ) |
|
| ) |
|
| (*pr->pr_usrreq)(so, PRU_RCVD, (struct mbuf *)0, |
(*pr->pr_usrreq)(so, PRU_RCVD, (struct mbuf *)0, |
| (struct mbuf *)(long)flags, (struct mbuf *)0, |
(struct mbuf *)(long)flags, (struct mbuf *)0, |
| (struct proc *)0); |
(struct proc *)0); |