* Rename ipfw_[un]bind_table_rule to ipfw_[un]ref_rule_tables

* Update their descriptions.
This commit is contained in:
Alexander V. Chernikov 2014-08-12 16:08:13 +00:00
parent 1940fa7727
commit e5eec6dd21
3 changed files with 7 additions and 10 deletions

View File

@ -658,7 +658,7 @@ commit_rules(struct ip_fw_chain *chain, struct rule_check_info *rci, int count)
ci--; ci--;
if (ci->table_opcodes == 0) if (ci->table_opcodes == 0)
continue; continue;
ipfw_unbind_table_rule(chain,ci->krule); ipfw_unref_rule_tables(chain,ci->krule);
} }
IPFW_UH_WUNLOCK(chain); IPFW_UH_WUNLOCK(chain);

View File

@ -2940,14 +2940,14 @@ ipfw_move_tables_sets(struct ip_fw_chain *ch, ipfw_range_tlv *rt,
/* /*
* Finds and bumps refcount for tables referenced by given @rule. * Finds and bumps refcount for tables referenced by given @rule.
* Allocates new indexes for non-existing tables. * Auto-creates non-existing tables.
* Fills in @oib array with userland/kernel indexes. * Fills in @oib array with userland/kernel indexes.
* First free oidx pointer is saved back in @oib. * First free oidx pointer is saved back in @oib.
* *
* Returns 0 on success. * Returns 0 on success.
*/ */
static int static int
bind_table_rule(struct ip_fw_chain *ch, struct ip_fw *rule, find_ref_rule_tables(struct ip_fw_chain *ch, struct ip_fw *rule,
struct rule_check_info *ci, struct obj_idx **oib, struct tid_info *ti) struct rule_check_info *ci, struct obj_idx **oib, struct tid_info *ti)
{ {
struct table_config *tc; struct table_config *tc;
@ -2969,10 +2969,7 @@ bind_table_rule(struct ip_fw_chain *ch, struct ip_fw *rule,
IPFW_UH_WLOCK(ch); IPFW_UH_WLOCK(ch);
ni = CHAIN_TO_NI(ch); ni = CHAIN_TO_NI(ch);
/* /* Increase refcount on each existing referenced table. */
* Increase refcount on each referenced table.
* Allocate table indexes for non-existing tables.
*/
for ( ; l > 0 ; l -= cmdlen, cmd += cmdlen) { for ( ; l > 0 ; l -= cmdlen, cmd += cmdlen) {
cmdlen = F_LEN(cmd); cmdlen = F_LEN(cmd);
@ -3071,7 +3068,7 @@ bind_table_rule(struct ip_fw_chain *ch, struct ip_fw *rule,
* Remove references from every table used in @rule. * Remove references from every table used in @rule.
*/ */
void void
ipfw_unbind_table_rule(struct ip_fw_chain *chain, struct ip_fw *rule) ipfw_unref_rule_tables(struct ip_fw_chain *chain, struct ip_fw *rule)
{ {
int cmdlen, l; int cmdlen, l;
ipfw_insn *cmd; ipfw_insn *cmd;
@ -3203,7 +3200,7 @@ ipfw_rewrite_table_uidx(struct ip_fw_chain *chain,
} }
/* Reference all used tables */ /* Reference all used tables */
error = bind_table_rule(chain, ci->krule, ci, &pidx_last, &ti); error = find_ref_rule_tables(chain, ci->krule, ci, &pidx_last, &ti);
if (error != 0) if (error != 0)
goto free; goto free;

View File

@ -176,7 +176,7 @@ int ipfw_mark_table_kidx(struct ip_fw_chain *chain, struct ip_fw *rule,
uint32_t *bmask); uint32_t *bmask);
int ipfw_export_table_ntlv(struct ip_fw_chain *ch, uint16_t kidx, int ipfw_export_table_ntlv(struct ip_fw_chain *ch, uint16_t kidx,
struct sockopt_data *sd); struct sockopt_data *sd);
void ipfw_unbind_table_rule(struct ip_fw_chain *chain, struct ip_fw *rule); void ipfw_unref_rule_tables(struct ip_fw_chain *chain, struct ip_fw *rule);
/* utility functions */ /* utility functions */
int ipfw_check_table_name(char *name); int ipfw_check_table_name(char *name);