Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135476
b: refs/heads/master
c: 4f1c3b7
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and Patrick McHardy committed Feb 18, 2009
1 parent 3ee53c1 commit 7ac8558
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cfac5ef7b92a2d504563989ecd0beb563920444b
refs/heads/master: 4f1c3b7e7ee4d841c8af3a074dc361d6a7a77803
23 changes: 11 additions & 12 deletions trunk/net/netfilter/xt_physdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ static bool
physdev_mt(const struct sk_buff *skb, const struct xt_match_param *par)
{
int i;
static const char nulldevname[IFNAMSIZ];
static const char nulldevname[IFNAMSIZ] __attribute__((aligned(sizeof(long))));
const struct xt_physdev_info *info = par->matchinfo;
bool ret;
unsigned long ret;
const char *indev, *outdev;
const struct nf_bridge_info *nf_bridge;

Expand Down Expand Up @@ -68,10 +68,10 @@ physdev_mt(const struct sk_buff *skb, const struct xt_match_param *par)
if (!(info->bitmask & XT_PHYSDEV_OP_IN))
goto match_outdev;
indev = nf_bridge->physindev ? nf_bridge->physindev->name : nulldevname;
for (i = 0, ret = false; i < IFNAMSIZ/sizeof(unsigned int); i++) {
ret |= (((const unsigned int *)indev)[i]
^ ((const unsigned int *)info->physindev)[i])
& ((const unsigned int *)info->in_mask)[i];
for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) {
ret |= (((const unsigned long *)indev)[i]
^ ((const unsigned long *)info->physindev)[i])
& ((const unsigned long *)info->in_mask)[i];
}

if (!ret ^ !(info->invert & XT_PHYSDEV_OP_IN))
Expand All @@ -82,13 +82,12 @@ physdev_mt(const struct sk_buff *skb, const struct xt_match_param *par)
return true;
outdev = nf_bridge->physoutdev ?
nf_bridge->physoutdev->name : nulldevname;
for (i = 0, ret = false; i < IFNAMSIZ/sizeof(unsigned int); i++) {
ret |= (((const unsigned int *)outdev)[i]
^ ((const unsigned int *)info->physoutdev)[i])
& ((const unsigned int *)info->out_mask)[i];
for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) {
ret |= (((const unsigned long *)outdev)[i]
^ ((const unsigned long *)info->physoutdev)[i])
& ((const unsigned long *)info->out_mask)[i];
}

return ret ^ !(info->invert & XT_PHYSDEV_OP_OUT);
return (!!ret ^ !(info->invert & XT_PHYSDEV_OP_OUT));
}

static bool physdev_mt_check(const struct xt_mtchk_param *par)
Expand Down

0 comments on commit 7ac8558

Please sign in to comment.