summaryrefslogtreecommitdiffstats
path: root/libarptc/libarptc_incl.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2015-04-01 12:16:30 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2015-04-02 10:32:37 +0200
commit5700dbf07266c1ab888dceee75a040eb7af40950 (patch)
tree5c8911d564aaf081a106aa34c4947ad8979524f7 /libarptc/libarptc_incl.c
parent4b7d6b0cac33d41cb3c74694ada06e19aa7e920e (diff)
src: cache in tree and use x_tables.h
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'libarptc/libarptc_incl.c')
-rw-r--r--libarptc/libarptc_incl.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/libarptc/libarptc_incl.c b/libarptc/libarptc_incl.c
index 1d2e8b7..a034930 100644
--- a/libarptc/libarptc_incl.c
+++ b/libarptc/libarptc_incl.c
@@ -40,13 +40,6 @@ struct counter_map
unsigned int mappos;
};
-/* Convenience structures */
-struct arpt_error_target
-{
- STRUCT_ENTRY_TARGET t;
- char error[TABLE_MAXNAMELEN];
-};
-
struct chain_cache
{
char name[TABLE_MAXNAMELEN];
@@ -1342,9 +1335,9 @@ TC_CREATE_CHAIN(const ARPT_CHAINLABEL chain, TC_HANDLE_T *handle)
newc.head.next_offset
= sizeof(STRUCT_ENTRY)
+ ALIGN(sizeof(struct arpt_error_target));
- strcpy(newc.name.t.u.user.name, ERROR_TARGET);
- newc.name.t.u.target_size = ALIGN(sizeof(struct arpt_error_target));
- strcpy(newc.name.error, chain);
+ strcpy(newc.name.target.u.user.name, ERROR_TARGET);
+ newc.name.target.u.target_size = ALIGN(sizeof(struct arpt_error_target));
+ strcpy(newc.name.errorname, chain);
newc.ret.target_offset = sizeof(STRUCT_ENTRY);
newc.ret.next_offset
@@ -1482,8 +1475,8 @@ int TC_RENAME_CHAIN(const ARPT_CHAINLABEL oldname,
t = (struct arpt_error_target *)
GET_TARGET(get_entry(*handle, labeloff));
- memset(t->error, 0, sizeof(t->error));
- strcpy(t->error, newname);
+ memset(t->errorname, 0, sizeof(t->errorname));
+ strcpy(t->errorname, newname);
set_changed(*handle);
return 1;