return 0;
}
+static inline __pure
+struct ebt_entry *ebt_next_entry(const struct ebt_entry *entry)
+{
+ return (void *)entry + entry->next_offset;
+}
+
/* Do some firewalling */
unsigned int ebt_do_table (unsigned int hook, struct sk_buff *skb,
const struct net_device *in, const struct net_device *out,
/* jump to a udc */
cs[sp].n = i + 1;
cs[sp].chaininfo = chaininfo;
- cs[sp].e = (struct ebt_entry *)
- (((char *)point) + point->next_offset);
+ cs[sp].e = ebt_next_entry(point);
i = 0;
chaininfo = (struct ebt_entries *) (base + verdict);
#ifdef CONFIG_NETFILTER_DEBUG
sp++;
continue;
letscontinue:
- point = (struct ebt_entry *)
- (((char *)point) + point->next_offset);
+ point = ebt_next_entry(point);
i++;
}
/* this can't be 0, so the loop test is correct */
cl_s[i].cs.n = pos + 1;
pos = 0;
- cl_s[i].cs.e = ((void *)e + e->next_offset);
+ cl_s[i].cs.e = ebt_next_entry(e);
e = (struct ebt_entry *)(hlp2->data);
nentries = hlp2->nentries;
cl_s[i].from = chain_nr;
continue;
}
letscontinue:
- e = (void *)e + e->next_offset;
+ e = ebt_next_entry(e);
pos++;
}
return 0;
return (struct arpt_entry *)(base + offset);
}
+static inline __pure
+struct arpt_entry *arpt_next_entry(const struct arpt_entry *entry)
+{
+ return (void *)entry + entry->next_offset;
+}
+
unsigned int arpt_do_table(struct sk_buff *skb,
unsigned int hook,
const struct net_device *in,
continue;
}
if (table_base + v
- != (void *)e + e->next_offset) {
+ != arpt_next_entry(e)) {
/* Save old back ptr in next entry */
struct arpt_entry *next
- = (void *)e + e->next_offset;
+ = arpt_next_entry(e);
next->comefrom =
(void *)back - table_base;
arp = arp_hdr(skb);
if (verdict == ARPT_CONTINUE)
- e = (void *)e + e->next_offset;
+ e = arpt_next_entry(e);
else
/* Verdict */
break;
}
} else {
- e = (void *)e + e->next_offset;
+ e = arpt_next_entry(e);
}
} while (!hotdrop);
xt_info_rdunlock_bh();
}
#endif
+static inline __pure
+struct ipt_entry *ipt_next_entry(const struct ipt_entry *entry)
+{
+ return (void *)entry + entry->next_offset;
+}
+
/* Returns one of the generic firewall policies, like NF_ACCEPT. */
unsigned int
ipt_do_table(struct sk_buff *skb,
back->comefrom);
continue;
}
- if (table_base + v != (void *)e + e->next_offset
+ if (table_base + v != ipt_next_entry(e)
&& !(e->ip.flags & IPT_F_GOTO)) {
/* Save old back ptr in next entry */
struct ipt_entry *next
- = (void *)e + e->next_offset;
+ = ipt_next_entry(e);
next->comefrom
= (void *)back - table_base;
/* set back pointer to next entry */
datalen = skb->len - ip->ihl * 4;
if (verdict == IPT_CONTINUE)
- e = (void *)e + e->next_offset;
+ e = ipt_next_entry(e);
else
/* Verdict */
break;
} else {
no_match:
- e = (void *)e + e->next_offset;
+ e = ipt_next_entry(e);
}
} while (!hotdrop);
xt_info_rdunlock_bh();
}
#endif
+static inline __pure struct ip6t_entry *
+ip6t_next_entry(const struct ip6t_entry *entry)
+{
+ return (void *)entry + entry->next_offset;
+}
+
/* Returns one of the generic firewall policies, like NF_ACCEPT. */
unsigned int
ip6t_do_table(struct sk_buff *skb,
back->comefrom);
continue;
}
- if (table_base + v != (void *)e + e->next_offset
+ if (table_base + v != ip6t_next_entry(e)
&& !(e->ipv6.flags & IP6T_F_GOTO)) {
/* Save old back ptr in next entry */
struct ip6t_entry *next
- = (void *)e + e->next_offset;
+ = ip6t_next_entry(e);
next->comefrom
= (void *)back - table_base;
/* set back pointer to next entry */
= 0x57acc001;
#endif
if (verdict == IP6T_CONTINUE)
- e = (void *)e + e->next_offset;
+ e = ip6t_next_entry(e);
else
/* Verdict */
break;
} else {
no_match:
- e = (void *)e + e->next_offset;
+ e = ip6t_next_entry(e);
}
} while (!hotdrop);