for (i = 0; i < num_possible_cpus(); i++) { 
for_each_cpu(i) { 
static int translate_table(struct ebt_replace *repl,   struct ebt_table_info *newinfo){	unsigned int i, j, k, udc_cnt;	int ret;	struct ebt_cl_stack *cl_s = NULL; /* used in the checking for chain loops */	i = 0;	while (i < NF_BR_NUMHOOKS && !(repl->valid_hooks & (1 << i)))		i++;	if (i == NF_BR_NUMHOOKS) {		BUGPRINT("No valid hooks specified\n");		return -EINVAL;	}	if (repl->hook_entry[i] != (struct ebt_entries *)repl->entries) {		BUGPRINT("Chains don't start at beginning\n");		return -EINVAL;	}	/* make sure chains are ordered after each other in same order	   as their corresponding hooks */	for (j = i + 1; j < NF_BR_NUMHOOKS; j++) {		if (!(repl->valid_hooks & (1 << j)))			continue;		if ( repl->hook_entry[j] <= repl->hook_entry[i] ) {			BUGPRINT("Hook order must be followed\n");			return -EINVAL;		}		i = j;	}	for (i = 0; i < NF_BR_NUMHOOKS; i++)		newinfo->hook_entry[i] = NULL;	newinfo->entries_size = repl->entries_size;	newinfo->nentries = repl->nentries;	/* do some early checkings and initialize some things */	i = 0; /* holds the expected nr. of entries for the chain */	j = 0; /* holds the up to now counted entries for the chain */	k = 0; /* holds the total nr. of entries, should equal	          newinfo->nentries afterwards */	udc_cnt = 0; /* will hold the nr. of user defined chains (udc) */	ret = EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,	   ebt_check_entry_size_and_hooks, newinfo, repl->entries,	   repl->entries + repl->entries_size, repl->hook_entry, &i, &j, &k,	   &udc_cnt, repl->valid_hooks);	if (ret != 0)		return ret;	if (i != j) {		BUGPRINT("nentries does not equal the nr of entries in the "		         "(last) chain\n");		return -EINVAL;	}	if (k != newinfo->nentries) {		BUGPRINT("Total nentries is wrong\n");		return -EINVAL;	}	/* check if all valid hooks have a chain */	for (i = 0; i < NF_BR_NUMHOOKS; i++) {		if (newinfo->hook_entry[i] == NULL &&		   (repl->valid_hooks & (1 << i))) {			BUGPRINT("Valid hook without chain\n");			return -EINVAL;		}	}	/* get the location of the udc, put them in an array	   while we're at it, allocate the chainstack */	if (udc_cnt) {		/* this will get free'd in do_replace()/ebt_register_table()		   if an error occurs */		newinfo->chainstack = (struct ebt_chainstack **)		   vmalloc(num_possible_cpus() * sizeof(struct ebt_chainstack));		if (!newinfo->chainstack)			return -ENOMEM;		for (i = 0; i < num_possible_cpus(); i++) {			newinfo->chainstack[i] =			   vmalloc(udc_cnt * sizeof(struct ebt_chainstack));			if (!newinfo->chainstack[i]) {				while (i)					vfree(newinfo->chainstack[--i]);				vfree(newinfo->chainstack);				newinfo->chainstack = NULL;				return -ENOMEM;			}		}		cl_s = (struct ebt_cl_stack *)		   vmalloc(udc_cnt * sizeof(struct ebt_cl_stack));		if (!cl_s)			return -ENOMEM;		i = 0; /* the i'th udc */		EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,		   ebt_get_udc_positions, newinfo, repl->hook_entry, &i,		   repl->valid_hooks, cl_s);		/* sanity check */		if (i != udc_cnt) {			BUGPRINT("i != udc_cnt\n");			vfree(cl_s);			return -EFAULT;		}	}	/* Check for loops */	for (i = 0; i < NF_BR_NUMHOOKS; i++)		if (repl->valid_hooks & (1 << i))			if (check_chainloops(newinfo->hook_entry[i],			   cl_s, udc_cnt, i, newinfo->entries)) {				vfree(cl_s);				return -EINVAL;			}	/* we now know the following (along with E=mc):	   - the nr of entries in each chain is right	   - the size of the allocated space is right	   - all valid hooks have a corresponding chain	   - there are no loops	   - wrong data can still be on the level of a single entry	   - could be there are jumps to places that are not the	     beginning of a chain. This can only occur in chains that	     are not accessible from any base chains, so we don't care. */	/* used to know what we need to clean up if something goes wrong */	i = 0;	ret = EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,	   ebt_check_entry, newinfo, repl->name, &i, repl->valid_hooks,	   cl_s, udc_cnt);	if (ret != 0) {		EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,		   ebt_cleanup_entry, &i);	}	vfree(cl_s);	return ret;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/c8923c6b852d3a97c1faad0566e38fca330375a7/ebtables.c/buggy/net/bridge/netfilter/ebtables.c