Skip to content

Commit

Permalink
netfilter 04/09: x_tables: fix match/target revision lookup
Browse files Browse the repository at this point in the history
Commit 55b69e9 (netfilter: implement NFPROTO_UNSPEC as a wildcard
for extensions) broke revision probing for matches and targets that
are registered with NFPROTO_UNSPEC.

Fix by continuing the search on the NFPROTO_UNSPEC list if nothing
is found on the af-specific lists.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
kaber authored and davem330 committed Jan 13, 2009
1 parent 47e0e1c commit 656caff
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/netfilter/x_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ static int match_revfn(u8 af, const char *name, u8 revision, int *bestp)
have_rev = 1;
}
}

if (af != NFPROTO_UNSPEC && !have_rev)
return match_revfn(NFPROTO_UNSPEC, name, revision, bestp);

return have_rev;
}

Expand All @@ -289,6 +293,10 @@ static int target_revfn(u8 af, const char *name, u8 revision, int *bestp)
have_rev = 1;
}
}

if (af != NFPROTO_UNSPEC && !have_rev)
return target_revfn(NFPROTO_UNSPEC, name, revision, bestp);

return have_rev;
}

Expand Down

0 comments on commit 656caff

Please sign in to comment.