Lines 458-463
soalloc(struct vnet *vnet)
Link Here
|
458 |
static void |
458 |
static void |
459 |
sodealloc(struct socket *so) |
459 |
sodealloc(struct socket *so) |
460 |
{ |
460 |
{ |
|
|
461 |
struct uidinfo *cr_uidinfo; |
461 |
|
462 |
|
462 |
KASSERT(so->so_count == 0, ("sodealloc(): so_count %d", so->so_count)); |
463 |
KASSERT(so->so_count == 0, ("sodealloc(): so_count %d", so->so_count)); |
463 |
KASSERT(so->so_pcb == NULL, ("sodealloc(): so_pcb != NULL")); |
464 |
KASSERT(so->so_pcb == NULL, ("sodealloc(): so_pcb != NULL")); |
Lines 476-481
sodealloc(struct socket *so)
Link Here
|
476 |
#endif |
477 |
#endif |
477 |
hhook_run_socket(so, NULL, HHOOK_SOCKET_CLOSE); |
478 |
hhook_run_socket(so, NULL, HHOOK_SOCKET_CLOSE); |
478 |
|
479 |
|
|
|
480 |
cr_uidinfo = so->so_cred->cr_uidinfo; |
479 |
crfree(so->so_cred); |
481 |
crfree(so->so_cred); |
480 |
khelp_destroy_osd(&so->osd); |
482 |
khelp_destroy_osd(&so->osd); |
481 |
if (SOLISTENING(so)) { |
483 |
if (SOLISTENING(so)) { |
Lines 483-492
sodealloc(struct socket *so)
Link Here
|
483 |
accept_filt_setopt(so, NULL); |
485 |
accept_filt_setopt(so, NULL); |
484 |
} else { |
486 |
} else { |
485 |
if (so->so_rcv.sb_hiwat) |
487 |
if (so->so_rcv.sb_hiwat) |
486 |
(void)chgsbsize(so->so_cred->cr_uidinfo, |
488 |
(void)chgsbsize(cr_uidinfo, |
487 |
&so->so_rcv.sb_hiwat, 0, RLIM_INFINITY); |
489 |
&so->so_rcv.sb_hiwat, 0, RLIM_INFINITY); |
488 |
if (so->so_snd.sb_hiwat) |
490 |
if (so->so_snd.sb_hiwat) |
489 |
(void)chgsbsize(so->so_cred->cr_uidinfo, |
491 |
(void)chgsbsize(cr_uidinfo, |
490 |
&so->so_snd.sb_hiwat, 0, RLIM_INFINITY); |
492 |
&so->so_snd.sb_hiwat, 0, RLIM_INFINITY); |
491 |
sx_destroy(&so->so_snd.sb_sx); |
493 |
sx_destroy(&so->so_snd.sb_sx); |
492 |
sx_destroy(&so->so_rcv.sb_sx); |
494 |
sx_destroy(&so->so_rcv.sb_sx); |