diff options
author | Zhang Chunyu <zhangcy@cn.fujitsu.com> | 2015-03-29 22:35:47 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-04-16 13:04:12 +0200 |
commit | dbbe9f7de36aa3c7dd61dc89092c03f7902e474e (patch) | |
tree | 35a473acfc8d24cfb9af26176fd387260b9db343 | |
parent | 935acea0326785834b22f2233e1b1e3f8d000f7d (diff) |
arptables: Add revision field for arptables userspace
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: Zhang Chunyu <zhangcy@cn.fujitsu.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | arptables.c | 2 | ||||
-rw-r--r-- | extensions/arpt_CLASSIFY.c | 1 | ||||
-rw-r--r-- | extensions/arpt_mangle.c | 1 | ||||
-rw-r--r-- | extensions/arpt_standard.c | 1 | ||||
-rw-r--r-- | include/arptables.h | 6 | ||||
-rw-r--r-- | libarptc/libarptc_incl.c | 2 |
6 files changed, 12 insertions, 1 deletions
diff --git a/arptables.c b/arptables.c index f820ffa..fbe7350 100644 --- a/arptables.c +++ b/arptables.c @@ -2067,6 +2067,7 @@ int do_command(int argc, char *argv[], char **table, arptc_handle_t *handle) target->t->u.target_size = size; strncpy(target->t->u.user.name, jumpto, sizeof(target->t->u.user.name)); target->t->u.user.name[sizeof(target->t->u.user.name)-1] = '\0'; + target->t->u.user.revision = target->revision; /* target->init(target->t, &fw.nfcache); */ @@ -2392,6 +2393,7 @@ int do_command(int argc, char *argv[], char **table, arptc_handle_t *handle) target->t = fw_calloc(1, size); target->t->u.target_size = size; strcpy(target->t->u.user.name, jumpto); + target->t->u.user.revision = target->revision; target->init(target->t); } diff --git a/extensions/arpt_CLASSIFY.c b/extensions/arpt_CLASSIFY.c index cb5770b..7893aed 100644 --- a/extensions/arpt_CLASSIFY.c +++ b/extensions/arpt_CLASSIFY.c @@ -105,6 +105,7 @@ struct arptables_target classify ARPTABLES_VERSION, ARPT_ALIGN(sizeof(struct xt_classify_target_info)), ARPT_ALIGN(sizeof(struct xt_classify_target_info)), + 0, &help, &init, &parse, diff --git a/extensions/arpt_mangle.c b/extensions/arpt_mangle.c index c38fc16..c7c3a7a 100644 --- a/extensions/arpt_mangle.c +++ b/extensions/arpt_mangle.c @@ -199,6 +199,7 @@ struct arptables_target change ARPTABLES_VERSION, ARPT_ALIGN(sizeof(struct arpt_mangle)), ARPT_ALIGN(sizeof(struct arpt_mangle)), + 0, &help, &init, &parse, diff --git a/extensions/arpt_standard.c b/extensions/arpt_standard.c index cb3891d..6c2b187 100644 --- a/extensions/arpt_standard.c +++ b/extensions/arpt_standard.c @@ -54,6 +54,7 @@ struct arptables_target standard ARPTABLES_VERSION, ARPT_ALIGN(sizeof(int)), ARPT_ALIGN(sizeof(int)), + 0, &help, &init, &parse, diff --git a/include/arptables.h b/include/arptables.h index 820b664..82e6e9a 100644 --- a/include/arptables.h +++ b/include/arptables.h @@ -32,6 +32,9 @@ struct arptables_match /* Size of match data relevent for userspace comparison purposes */ size_t userspacesize; + /* Revision of target (0 by default). */ + u_int8_t revision; + /* Function which prints out usage message. */ void (*help)(void); @@ -81,6 +84,9 @@ struct arptables_target /* Size of target data relevent for userspace comparison purposes */ size_t userspacesize; + /* Revision of target (0 by default). */ + u_int8_t revision; + /* Function which prints out usage message. */ void (*help)(void); diff --git a/libarptc/libarptc_incl.c b/libarptc/libarptc_incl.c index a034930..87404ce 100644 --- a/libarptc/libarptc_incl.c +++ b/libarptc/libarptc_incl.c @@ -872,7 +872,7 @@ map_target(const TC_HANDLE_T handle, /* memset to all 0 for your memcmp convenience. */ memset(t->u.user.name + strlen(t->u.user.name), 0, - FUNCTION_MAXNAMELEN - strlen(t->u.user.name)); + FUNCTION_MAXNAMELEN - 1 - strlen(t->u.user.name)); return 1; } |