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:
Alfred Perlstein 2003-01-05 11:14:04 +00:00
parent f576a06e22
commit a09de2f7cd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=108708

View File

@ -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);