version 1.235.2.1, 2015/04/06 15:18:20 |
version 1.243, 2015/05/02 23:46:04 |
Line 793 soabort(struct socket *so) |
|
Line 793 soabort(struct socket *so) |
|
} |
} |
|
|
int |
int |
soaccept(struct socket *so, struct mbuf *nam) |
soaccept(struct socket *so, struct sockaddr *nam) |
{ |
{ |
int error; |
int error; |
|
|
Line 811 soaccept(struct socket *so, struct mbuf |
|
Line 811 soaccept(struct socket *so, struct mbuf |
|
} |
} |
|
|
int |
int |
soconnect(struct socket *so, struct mbuf *nam, struct lwp *l) |
soconnect(struct socket *so, struct sockaddr *nam, struct lwp *l) |
{ |
{ |
int error; |
int error; |
|
|
Line 827 soconnect(struct socket *so, struct mbuf |
|
Line 827 soconnect(struct socket *so, struct mbuf |
|
*/ |
*/ |
if (so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING) && |
if (so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING) && |
((so->so_proto->pr_flags & PR_CONNREQUIRED) || |
((so->so_proto->pr_flags & PR_CONNREQUIRED) || |
(error = sodisconnect(so)))) |
(error = sodisconnect(so)))) { |
error = EISCONN; |
error = EISCONN; |
else |
} else { |
|
if (nam->sa_family != so->so_proto->pr_domain->dom_family) { |
|
return EAFNOSUPPORT; |
|
} |
error = (*so->so_proto->pr_usrreqs->pr_connect)(so, nam, l); |
error = (*so->so_proto->pr_usrreqs->pr_connect)(so, nam, l); |
|
} |
|
|
return error; |
return error; |
} |
} |
Line 937 sosend(struct socket *so, struct mbuf *a |
|
Line 941 sosend(struct socket *so, struct mbuf *a |
|
error = ENOTCONN; |
error = ENOTCONN; |
goto release; |
goto release; |
} |
} |
} else if (addr == 0) { |
} else if (NULL == addr) { |
error = EDESTADDRREQ; |
error = EDESTADDRREQ; |
goto release; |
goto release; |
} |
} |
Line 1051 sosend(struct socket *so, struct mbuf *a |
|
Line 1055 sosend(struct socket *so, struct mbuf *a |
|
so->so_options |= SO_DONTROUTE; |
so->so_options |= SO_DONTROUTE; |
if (resid > 0) |
if (resid > 0) |
so->so_state |= SS_MORETOCOME; |
so->so_state |= SS_MORETOCOME; |
if (flags & MSG_OOB) |
if (flags & MSG_OOB) { |
error = (*so->so_proto->pr_usrreqs->pr_sendoob)(so, |
error = (*so->so_proto->pr_usrreqs->pr_sendoob)(so, |
top, control); |
top, control); |
else |
} else { |
|
struct sockaddr *sin = NULL; |
|
if (addr) { |
|
sin = mtod(addr, struct sockaddr *); |
|
} |
error = (*so->so_proto->pr_usrreqs->pr_send)(so, |
error = (*so->so_proto->pr_usrreqs->pr_send)(so, |
top, addr, control, l); |
top, sin, control, l); |
|
} |
if (dontroute) |
if (dontroute) |
so->so_options &= ~SO_DONTROUTE; |
so->so_options &= ~SO_DONTROUTE; |
if (resid > 0) |
if (resid > 0) |