{ {NULL, NULL}, EBT_STANDARD_TARGET, NULL, NULL, NULL, NULL};
static inline int ebt_do_watcher (struct ebt_entry_watcher *w,
- const struct sk_buff *skb, const struct net_device *in,
+ const struct sk_buff *skb, unsigned int hooknr, const struct net_device *in,
const struct net_device *out)
{
- w->u.watcher->watcher(skb, in, out, w->data,
+ w->u.watcher->watcher(skb, hooknr, in, out, w->data,
w->watcher_size);
/* watchers don't give a verdict */
return 0;
static inline int ebt_dev_check(char *entry, const struct net_device *device)
{
+ int i = 0;
+ char *devname = device->name;
+
if (*entry == '\0')
return 0;
if (!device)
return 1;
- return !!strcmp(entry, device->name);
+ /* 1 is the wildcard token */
+ while (entry[i] != '\0' && entry[i] != 1 && entry[i] == devname[i])
+ i++;
+ return (devname[i] != entry[i] && entry[i] != 1);
}
#define FWINV2(bool,invflg) ((bool) ^ !!(e->invflags & invflg))
struct ebt_chainstack *cs;
struct ebt_entries *chaininfo;
char *base;
- struct ebt_table_info *private = table->private;
+ struct ebt_table_info *private;
read_lock_bh(&table->lock);
+ private = table->private;
cb_base = COUNTER_BASE(private->counters, private->nentries,
smp_processor_id());
if (private->chainstack)
base = private->entries;
i = 0;
while (i < nentries) {
- if (ebt_basic_match(point, (**pskb).mac.ethernet, in, out))
+ if (ebt_basic_match(point, eth_hdr(*pskb), in, out))
goto letscontinue;
if (EBT_MATCH_ITERATE(point, ebt_do_match, *pskb, in, out) != 0)
/* these should only watch: not modify, nor tell us
what to do with the packet */
- EBT_WATCHER_ITERATE(point, ebt_do_watcher, *pskb, in,
+ EBT_WATCHER_ITERATE(point, ebt_do_watcher, *pskb, hook, in,
out);
t = (struct ebt_entry_target *)
}
/* replace the table */
-static int do_replace(void *user, unsigned int len)
+static int do_replace(void __user *user, unsigned int len)
{
int ret, i, countersize;
struct ebt_table_info *newinfo;
}
table->private = newinfo;
- table->lock = RW_LOCK_UNLOCKED;
+ rwlock_init(&table->lock);
ret = down_interruptible(&ebt_mutex);
if (ret != 0)
goto free_chainstack;
}
/* userspace just supplied us with counters */
-static int update_counters(void *user, unsigned int len)
+static int update_counters(void __user *user, unsigned int len)
{
int i, ret;
struct ebt_counter *tmp;
}
/* called with ebt_mutex down */
-static int copy_everything_to_user(struct ebt_table *t, void *user,
+static int copy_everything_to_user(struct ebt_table *t, void __user *user,
int *len, int cmd)
{
struct ebt_replace tmp;
}
static int do_ebt_set_ctl(struct sock *sk,
- int cmd, void *user, unsigned int len)
+ int cmd, void __user *user, unsigned int len)
{
int ret;
return ret;
}
-static int do_ebt_get_ctl(struct sock *sk, int cmd, void *user, int *len)
+static int do_ebt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
{
int ret;
struct ebt_replace tmp;