if (buffer == NULL)
xtables_error(OTHER_PROBLEM, "strdup failed");
- for (cp=buffer, i=0; cp != NULL && i<XT_PKNOCK_MAX_PORTS; cp=next, i++)
+ for (cp = buffer, i = 0; cp != NULL && i < XT_PKNOCK_MAX_PORTS; cp = next, ++i)
{
next=strchr(cp, ',');
if (next != NULL)
printf("pknock ");
if (info->option & XT_PKNOCK_KNOCKPORT) {
printf("knockports ");
- for (i=0; i<info->ports_count; i++)
+ for (i = 0; i < info->ports_count; ++i)
printf("%s%d", i ? "," : "", info->port[i]);
printf(" ");
}
if (info->option & XT_PKNOCK_KNOCKPORT) {
printf("--knockports ");
- for (i=0; i<info->ports_count; i++)
+ for (i = 0; i < info->ports_count; ++i)
printf("%s%d", i ? "," : "", info->port[i]);
printf(" ");
}
};
#define hashtable_for_each_safe(pos, n, head, size, i) \
- for ((i) = 0; (i) < (size); (i)++) \
+ for ((i) = 0; (i) < (size); ++(i)) \
list_for_each_safe((pos), (n), (&head[(i)]))
#define pk_debug(msg, peer) pr_debug( \
return NULL;
}
- for (i = 0; i < size; i++)
+ for (i = 0; i < size; ++i)
INIT_LIST_HEAD(&hash[i]);
return hash;
const struct proc_dir_entry *pde = s->private;
const struct xt_pknock_rule *rule = pde->data;
- (*pos)++;
+ ++*pos;
if (*pos >= peer_hashsize)
return NULL;
rule = list_entry(pos, struct xt_pknock_rule, head);
if (rulecmp(info, rule)) {
- rule->ref_count++;
+ ++rule->ref_count;
if (info->option & XT_PKNOCK_CHECKIP) {
pr_debug("add_rule() (AC)"
" rule found: %s - "
crypt_to_hex(char *out, const char *crypt, unsigned int size)
{
unsigned int i;
- for (i=0; i < size; i++) {
+ for (i = 0; i < size; ++i) {
unsigned char c = crypt[i];
*out++ = '0' + ((c&0xf0)>>4) + (c>=0xa0)*('a'-'9'-1);
*out++ = '0' + (c&0x0f) + ((c&0x0f)>=0x0a)*('a'-'9'-1);
/* Just update the timer when there is a state change. */
update_rule_timer(rule);
- peer->id_port_knocked++;
+ ++peer->id_port_knocked;
if (is_last_knock(peer, info)) {
peer->status = ST_ALLOWED;