|
@@ -205,13 +205,14 @@ static void tcf_chain_head_change(struct tcf_chain *chain,
|
|
|
|
|
|
static void tcf_chain_flush(struct tcf_chain *chain)
|
|
static void tcf_chain_flush(struct tcf_chain *chain)
|
|
{
|
|
{
|
|
- struct tcf_proto *tp;
|
|
|
|
|
|
+ struct tcf_proto *tp = rtnl_dereference(chain->filter_chain);
|
|
|
|
|
|
tcf_chain_head_change(chain, NULL);
|
|
tcf_chain_head_change(chain, NULL);
|
|
- while ((tp = rtnl_dereference(chain->filter_chain)) != NULL) {
|
|
|
|
|
|
+ while (tp) {
|
|
RCU_INIT_POINTER(chain->filter_chain, tp->next);
|
|
RCU_INIT_POINTER(chain->filter_chain, tp->next);
|
|
- tcf_chain_put(chain);
|
|
|
|
tcf_proto_destroy(tp);
|
|
tcf_proto_destroy(tp);
|
|
|
|
+ tp = rtnl_dereference(chain->filter_chain);
|
|
|
|
+ tcf_chain_put(chain);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|