Lines 160-165
Link Here
|
160 |
static u_long unpdg_recvspace = 4*1024; |
160 |
static u_long unpdg_recvspace = 4*1024; |
161 |
static u_long unpsp_sendspace = PIPSIZ; /* really max datagram size */ |
161 |
static u_long unpsp_sendspace = PIPSIZ; /* really max datagram size */ |
162 |
static u_long unpsp_recvspace = PIPSIZ; |
162 |
static u_long unpsp_recvspace = PIPSIZ; |
|
|
163 |
static int bind_exist_errext = 0; |
163 |
|
164 |
|
164 |
static SYSCTL_NODE(_net, PF_LOCAL, local, CTLFLAG_RW, 0, "Local domain"); |
165 |
static SYSCTL_NODE(_net, PF_LOCAL, local, CTLFLAG_RW, 0, "Local domain"); |
165 |
static SYSCTL_NODE(_net_local, SOCK_STREAM, stream, CTLFLAG_RW, 0, |
166 |
static SYSCTL_NODE(_net_local, SOCK_STREAM, stream, CTLFLAG_RW, 0, |
Lines 180-185
Link Here
|
180 |
&unpsp_sendspace, 0, "Default seqpacket send space."); |
181 |
&unpsp_sendspace, 0, "Default seqpacket send space."); |
181 |
SYSCTL_ULONG(_net_local_seqpacket, OID_AUTO, recvspace, CTLFLAG_RW, |
182 |
SYSCTL_ULONG(_net_local_seqpacket, OID_AUTO, recvspace, CTLFLAG_RW, |
182 |
&unpsp_recvspace, 0, "Default seqpacket receive space."); |
183 |
&unpsp_recvspace, 0, "Default seqpacket receive space."); |
|
|
184 |
SYSCTL_INT(_net_local, OID_AUTO, bind_exist_errext, CTLFLAG_RW, |
185 |
&bind_exist_errext, 0, |
186 |
"bind() will report EEXIST for non-bound-socket existing files."); |
183 |
SYSCTL_INT(_net_local, OID_AUTO, inflight, CTLFLAG_RD, &unp_rights, 0, |
187 |
SYSCTL_INT(_net_local, OID_AUTO, inflight, CTLFLAG_RD, &unp_rights, 0, |
184 |
"File descriptors in flight."); |
188 |
"File descriptors in flight."); |
185 |
SYSCTL_INT(_net_local, OID_AUTO, deferred, CTLFLAG_RD, |
189 |
SYSCTL_INT(_net_local, OID_AUTO, deferred, CTLFLAG_RD, |
Lines 463-471
Link Here
|
463 |
struct vattr vattr; |
467 |
struct vattr vattr; |
464 |
int error, namelen; |
468 |
int error, namelen; |
465 |
struct nameidata nd; |
469 |
struct nameidata nd; |
466 |
struct unpcb *unp; |
470 |
struct unpcb *unp, *unp2; |
467 |
struct vnode *vp; |
471 |
struct vnode *vp; |
468 |
struct mount *mp; |
472 |
struct mount *mp; |
469 |
cap_rights_t rights; |
473 |
cap_rights_t rights; |
470 |
char *buf; |
474 |
char *buf; |
471 |
|
475 |
|
Lines 521-528
Link Here
|
521 |
else |
525 |
else |
522 |
vput(nd.ni_dvp); |
526 |
vput(nd.ni_dvp); |
523 |
if (vp != NULL) { |
527 |
if (vp != NULL) { |
|
|
528 |
if (bind_exist_errext == 1) |
529 |
VOP_UNP_CONNECT(vp, &unp2); |
524 |
vrele(vp); |
530 |
vrele(vp); |
525 |
error = EADDRINUSE; |
531 |
if (bind_exist_errext == 1 && unp2 == NULL) |
|
|
532 |
error = EEXIST; |
533 |
else |
534 |
error = EADDRINUSE; |
526 |
goto error; |
535 |
goto error; |
527 |
} |
536 |
} |
528 |
error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH); |
537 |
error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH); |