version 1.205.2.1, 2012/04/17 00:08:30 |
version 1.209.2.2.2.1, 2013/08/02 20:18:48 |
Line 416 socket_listener_cb(kauth_cred_t cred, ka |
|
Line 416 socket_listener_cb(kauth_cred_t cred, ka |
|
/* Normal users can only drop their own connections. */ |
/* Normal users can only drop their own connections. */ |
struct socket *so = (struct socket *)arg1; |
struct socket *so = (struct socket *)arg1; |
|
|
if (proc_uidmatch(cred, so->so_cred)) |
if (proc_uidmatch(cred, so->so_cred) == 0) |
result = KAUTH_RESULT_ALLOW; |
result = KAUTH_RESULT_ALLOW; |
|
|
break; |
break; |
Line 585 fsocreate(int domain, struct socket **so |
|
Line 585 fsocreate(int domain, struct socket **so |
|
fp->f_data = so; |
fp->f_data = so; |
fd_affix(curproc, fp, fd); |
fd_affix(curproc, fp, fd); |
*fdout = fd; |
*fdout = fd; |
|
if (flags & SOCK_NONBLOCK) |
|
so->so_state |= SS_NBIO; |
} |
} |
return error; |
return error; |
} |
} |
Line 622 solisten(struct socket *so, int backlog, |
|
Line 624 solisten(struct socket *so, int backlog, |
|
if ((so->so_state & (SS_ISCONNECTED | SS_ISCONNECTING | |
if ((so->so_state & (SS_ISCONNECTED | SS_ISCONNECTING | |
SS_ISDISCONNECTING)) != 0) { |
SS_ISDISCONNECTING)) != 0) { |
sounlock(so); |
sounlock(so); |
return (EINVAL); |
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); |
Line 1132 soreceive(struct socket *so, struct mbuf |
|
Line 1134 soreceive(struct socket *so, struct mbuf |
|
{ |
{ |
struct lwp *l = curlwp; |
struct lwp *l = curlwp; |
struct mbuf *m, **mp, *mt; |
struct mbuf *m, **mp, *mt; |
int atomic, flags, len, error, s, offset, moff, type, orig_resid; |
size_t len, offset, moff, orig_resid; |
|
int atomic, flags, error, s, type; |
const struct protosw *pr; |
const struct protosw *pr; |
struct mbuf *nextrecord; |
struct mbuf *nextrecord; |
int mbuf_removed = 0; |
int mbuf_removed = 0; |
Line 1165 soreceive(struct socket *so, struct mbuf |
|
Line 1168 soreceive(struct socket *so, struct mbuf |
|
goto bad; |
goto bad; |
do { |
do { |
error = uiomove(mtod(m, void *), |
error = uiomove(mtod(m, void *), |
(int) min(uio->uio_resid, m->m_len), uio); |
MIN(uio->uio_resid, m->m_len), uio); |
m = m_free(m); |
m = m_free(m); |
} while (uio->uio_resid > 0 && error == 0 && m); |
} while (uio->uio_resid > 0 && error == 0 && m); |
bad: |
bad: |
Line 1419 soreceive(struct socket *so, struct mbuf |
|
Line 1422 soreceive(struct socket *so, struct mbuf |
|
SBLASTMBUFCHK(&so->so_rcv, "soreceive uiomove"); |
SBLASTMBUFCHK(&so->so_rcv, "soreceive uiomove"); |
sounlock(so); |
sounlock(so); |
splx(s); |
splx(s); |
error = uiomove(mtod(m, char *) + moff, (int)len, uio); |
error = uiomove(mtod(m, char *) + moff, len, uio); |
s = splsoftnet(); |
s = splsoftnet(); |
solock(so); |
solock(so); |
if (error != 0) { |
if (error != 0) { |