Fix indentation in a loop and a tiny maze of #ifdefs for just the

__FreeBSD__ parts that had it wrong.

MFC after:	3 days
This commit is contained in:
Bjoern A. Zeeb 2011-10-19 08:37:48 +00:00
parent ca0b8be4ee
commit 8552ee4b89

View File

@ -1342,42 +1342,42 @@ pf_purge_thread(void *v)
tsleep(pf_purge_thread, PWAIT, "pftm", 1 * hz); tsleep(pf_purge_thread, PWAIT, "pftm", 1 * hz);
#ifdef __FreeBSD__ #ifdef __FreeBSD__
sx_slock(&V_pf_consistency_lock); sx_slock(&V_pf_consistency_lock);
PF_LOCK();
locked = 0;
if (V_pf_end_threads) {
PF_UNLOCK();
sx_sunlock(&V_pf_consistency_lock);
sx_xlock(&V_pf_consistency_lock);
PF_LOCK(); PF_LOCK();
locked = 0;
pf_purge_expired_states(V_pf_status.states, 1); if (V_pf_end_threads) {
pf_purge_expired_fragments(); PF_UNLOCK();
pf_purge_expired_src_nodes(1); sx_sunlock(&V_pf_consistency_lock);
V_pf_end_threads++; sx_xlock(&V_pf_consistency_lock);
PF_LOCK();
sx_xunlock(&V_pf_consistency_lock); pf_purge_expired_states(V_pf_status.states, 1);
PF_UNLOCK(); pf_purge_expired_fragments();
wakeup(pf_purge_thread); pf_purge_expired_src_nodes(1);
kproc_exit(0); V_pf_end_threads++;
}
sx_xunlock(&V_pf_consistency_lock);
PF_UNLOCK();
wakeup(pf_purge_thread);
kproc_exit(0);
}
#endif #endif
s = splsoftnet(); s = splsoftnet();
/* process a fraction of the state table every second */ /* process a fraction of the state table every second */
#ifdef __FreeBSD__ #ifdef __FreeBSD__
if (!pf_purge_expired_states(1 + (V_pf_status.states / if (!pf_purge_expired_states(1 + (V_pf_status.states /
V_pf_default_rule.timeout[PFTM_INTERVAL]), 0)) { V_pf_default_rule.timeout[PFTM_INTERVAL]), 0)) {
PF_UNLOCK(); PF_UNLOCK();
sx_sunlock(&V_pf_consistency_lock); sx_sunlock(&V_pf_consistency_lock);
sx_xlock(&V_pf_consistency_lock); sx_xlock(&V_pf_consistency_lock);
PF_LOCK(); PF_LOCK();
locked = 1; locked = 1;
pf_purge_expired_states(1 + (V_pf_status.states / pf_purge_expired_states(1 + (V_pf_status.states /
V_pf_default_rule.timeout[PFTM_INTERVAL]), 1); V_pf_default_rule.timeout[PFTM_INTERVAL]), 1);
} }
#else #else
pf_purge_expired_states(1 + (pf_status.states pf_purge_expired_states(1 + (pf_status.states
/ pf_default_rule.timeout[PFTM_INTERVAL])); / pf_default_rule.timeout[PFTM_INTERVAL]));