Commit eabaca3a authored by Bart De Schuymer's avatar Bart De Schuymer Committed by David S. Miller

[EBTABLES]: Add wildcard support for interface matching.

Due to an old braindead decision, ebtables doesn't yet support the
wildcard '+' for matching interface names. The following patch removes
this nuissance and is backwards compatible.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6f60f5cf
...@@ -109,11 +109,17 @@ static inline int ebt_do_match (struct ebt_entry_match *m, ...@@ -109,11 +109,17 @@ static inline int ebt_do_match (struct ebt_entry_match *m,
static inline int ebt_dev_check(char *entry, const struct net_device *device) static inline int ebt_dev_check(char *entry, const struct net_device *device)
{ {
int i = 0;
char *devname = device->name;
if (*entry == '\0') if (*entry == '\0')
return 0; return 0;
if (!device) if (!device)
return 1; 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)) #define FWINV2(bool,invflg) ((bool) ^ !!(e->invflags & invflg))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment