netfilter: ebtables: Add support for specifying match revision
Currently ebtables assumes that the revision number of all match modules is 0, which is an issue when trying to use existing xtables matches with ebtables. The solution is to modify ebtables to allow extensions to specify a revision number, similar to iptables. This gets passed down to the kernel, which is then able to find the match module correctly. To main binary backwards compatibility, the size of the ebt_entry structures is not changed, only the size of the name field is decreased by 1 byte to make room for the revision field. Signed-off-by: Bernie Harris <bernie.harris@alliedtelesis.co.nz> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
committed by
Pablo Neira Ayuso
parent
78d9f4d49b
commit
39c202d228
@@ -20,6 +20,7 @@
|
||||
#define EBT_TABLE_MAXNAMELEN 32
|
||||
#define EBT_CHAIN_MAXNAMELEN EBT_TABLE_MAXNAMELEN
|
||||
#define EBT_FUNCTION_MAXNAMELEN EBT_TABLE_MAXNAMELEN
|
||||
#define EBT_EXTENSION_MAXNAMELEN 31
|
||||
|
||||
/* verdicts >0 are "branches" */
|
||||
#define EBT_ACCEPT -1
|
||||
@@ -120,7 +121,10 @@ struct ebt_entries {
|
||||
|
||||
struct ebt_entry_match {
|
||||
union {
|
||||
char name[EBT_FUNCTION_MAXNAMELEN];
|
||||
struct {
|
||||
char name[EBT_EXTENSION_MAXNAMELEN];
|
||||
uint8_t revision;
|
||||
};
|
||||
struct xt_match *match;
|
||||
} u;
|
||||
/* size of data */
|
||||
@@ -130,7 +134,10 @@ struct ebt_entry_match {
|
||||
|
||||
struct ebt_entry_watcher {
|
||||
union {
|
||||
char name[EBT_FUNCTION_MAXNAMELEN];
|
||||
struct {
|
||||
char name[EBT_EXTENSION_MAXNAMELEN];
|
||||
uint8_t revision;
|
||||
};
|
||||
struct xt_target *watcher;
|
||||
} u;
|
||||
/* size of data */
|
||||
@@ -140,7 +147,10 @@ struct ebt_entry_watcher {
|
||||
|
||||
struct ebt_entry_target {
|
||||
union {
|
||||
char name[EBT_FUNCTION_MAXNAMELEN];
|
||||
struct {
|
||||
char name[EBT_EXTENSION_MAXNAMELEN];
|
||||
uint8_t revision;
|
||||
};
|
||||
struct xt_target *target;
|
||||
} u;
|
||||
/* size of data */
|
||||
|
||||
Reference in New Issue
Block a user