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 585-593
Link Here
|
585 |
struct vattr vattr; |
589 |
struct vattr vattr; |
586 |
int error, namelen; |
590 |
int error, namelen; |
587 |
struct nameidata nd; |
591 |
struct nameidata nd; |
588 |
struct unpcb *unp; |
592 |
struct unpcb *unp, *unp2; |
589 |
struct vnode *vp; |
593 |
struct vnode *vp; |
590 |
struct mount *mp; |
594 |
struct mount *mp; |
591 |
cap_rights_t rights; |
595 |
cap_rights_t rights; |
592 |
char *buf; |
596 |
char *buf; |
593 |
|
597 |
|
Lines 643-650
Link Here
|
643 |
else |
647 |
else |
644 |
vput(nd.ni_dvp); |
648 |
vput(nd.ni_dvp); |
645 |
if (vp != NULL) { |
649 |
if (vp != NULL) { |
|
|
650 |
if (bind_exist_errext == 1) |
651 |
VOP_UNP_CONNECT(vp, &unp2); |
646 |
vrele(vp); |
652 |
vrele(vp); |
647 |
error = EADDRINUSE; |
653 |
if (bind_exist_errext == 1 && unp2 == NULL) |
|
|
654 |
error = EEXIST; |
655 |
else |
656 |
error = EADDRINUSE; |
648 |
goto error; |
657 |
goto error; |
649 |
} |
658 |
} |
650 |
error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH); |
659 |
error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH); |