In sodealloc(), if there is an accept filter present on the socket
then call do_setopt_accept_filter(so, NULL) which will free the filter instead of duplicating the code in do_setopt_accept_filter(). Pointed out by: Hiten Pandya <hiten@angelica.unixdaemons.com>
This commit is contained in:
parent
f576a06e22
commit
a09de2f7cd
@ -244,15 +244,9 @@ sodealloc(struct socket *so)
|
||||
(void)chgsbsize(so->so_cred->cr_uidinfo,
|
||||
&so->so_snd.sb_hiwat, 0, RLIM_INFINITY);
|
||||
#ifdef INET
|
||||
if (so->so_accf != NULL) {
|
||||
if (so->so_accf->so_accept_filter != NULL &&
|
||||
so->so_accf->so_accept_filter->accf_destroy != NULL) {
|
||||
so->so_accf->so_accept_filter->accf_destroy(so);
|
||||
}
|
||||
if (so->so_accf->so_accept_filter_str != NULL)
|
||||
FREE(so->so_accf->so_accept_filter_str, M_ACCF);
|
||||
FREE(so->so_accf, M_ACCF);
|
||||
}
|
||||
/* remove acccept filter if one is present. */
|
||||
if (so->so_accf != NULL)
|
||||
do_setopt_accept_filter(so, NULL);
|
||||
#endif
|
||||
#ifdef MAC
|
||||
mac_destroy_socket(so);
|
||||
|
Loading…
x
Reference in New Issue
Block a user