Commit b84afe5e authored by jan.koester's avatar jan.koester
Browse files

some fixes

parent 72a60c24
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -327,12 +327,6 @@ void flow_offload_refresh(struct nf_flowtable *flow_table,
}
EXPORT_SYMBOL_GPL(flow_offload_refresh);

static bool nf_flow_is_outdated(const struct flow_offload *flow)
{
	return test_bit(IPS_SEEN_REPLY_BIT, &flow->ct->status) &&
		!test_bit(NF_FLOW_HW_ESTABLISHED, &flow->flags);
}

static inline bool nf_flow_has_expired(const struct flow_offload *flow)
{
	return nf_flow_timeout_delta(flow->timeout) <= 0;
@@ -418,12 +412,18 @@ nf_flow_table_iterate(struct nf_flowtable *flow_table,
	return err;
}

static bool nf_flow_custom_gc(struct nf_flowtable *flow_table,
			      const struct flow_offload *flow)
{
	return flow_table->type->gc && flow_table->type->gc(flow);
}

static void nf_flow_offload_gc_step(struct nf_flowtable *flow_table,
				    struct flow_offload *flow, void *data)
{
	if (nf_flow_has_expired(flow) ||
	    nf_ct_is_dying(flow->ct) ||
	    nf_flow_is_outdated(flow))
	    nf_flow_custom_gc(flow_table, flow))
		flow_offload_teardown(flow);

	if (test_bit(NF_FLOW_TEARDOWN, &flow->flags)) {