]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libiptc: resolve compile failure
authorJan Engelhardt <jengelh@medozas.de>
Sun, 11 Sep 2011 15:24:26 +0000 (17:24 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Sun, 11 Sep 2011 15:31:34 +0000 (17:31 +0200)
  CC     libip4tc.lo
In file included from libip4tc.c:118:0:
libiptc.c:70:8: error: redefinition of "struct xt_error_target"
../include/linux/netfilter/x_tables.h:69:8: note: originally defined here

Remove libiptc's duplicate definition and substitute names.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
libiptc/libiptc.c

index 42d9784a491870d74a964563aab5ad279176fd73..2214077eba7d589d0f6957bd272a54f34bb6421d 100644 (file)
@@ -67,12 +67,6 @@ static const char *hooknames[] = {
 };
 
 /* Convenience structures */
-struct ipt_error_target
-{
-       STRUCT_ENTRY_TARGET t;
-       char error[TABLE_MAXNAMELEN];
-};
-
 struct chain_head;
 struct rule_head;
 
@@ -1092,10 +1086,10 @@ static int parse_table(struct xtc_handle *h)
 /* Convenience structures */
 struct iptcb_chain_start{
        STRUCT_ENTRY e;
-       struct ipt_error_target name;
+       struct xt_error_target name;
 };
 #define IPTCB_CHAIN_START_SIZE (sizeof(STRUCT_ENTRY) +                 \
-                                ALIGN(sizeof(struct ipt_error_target)))
+                                ALIGN(sizeof(struct xt_error_target)))
 
 struct iptcb_chain_foot {
        STRUCT_ENTRY e;
@@ -1106,10 +1100,10 @@ struct iptcb_chain_foot {
 
 struct iptcb_chain_error {
        STRUCT_ENTRY entry;
-       struct ipt_error_target target;
+       struct xt_error_target target;
 };
 #define IPTCB_CHAIN_ERROR_SIZE (sizeof(STRUCT_ENTRY) +                 \
-                                ALIGN(sizeof(struct ipt_error_target)))
+                                ALIGN(sizeof(struct xt_error_target)))
 
 
 
@@ -1152,10 +1146,10 @@ static int iptcc_compile_chain(struct xtc_handle *h, STRUCT_REPLACE *repl, struc
                head = (void *)repl->entries + c->head_offset;
                head->e.target_offset = sizeof(STRUCT_ENTRY);
                head->e.next_offset = IPTCB_CHAIN_START_SIZE;
-               strcpy(head->name.t.u.user.name, ERROR_TARGET);
-               head->name.t.u.target_size =
-                               ALIGN(sizeof(struct ipt_error_target));
-               strcpy(head->name.error, c->name);
+               strcpy(head->name.target.u.user.name, ERROR_TARGET);
+               head->name.target.u.target_size =
+                               ALIGN(sizeof(struct xt_error_target));
+               strcpy(head->name.errorname, c->name);
        } else {
                repl->hook_entry[c->hooknum-1] = c->head_offset;
                repl->underflow[c->hooknum-1] = c->foot_offset;
@@ -1198,7 +1192,7 @@ static int iptcc_compile_chain_offsets(struct xtc_handle *h, struct chain_head *
        if (!iptcc_is_builtin(c))  {
                /* Chain has header */
                *offset += sizeof(STRUCT_ENTRY)
-                            + ALIGN(sizeof(struct ipt_error_target));
+                            + ALIGN(sizeof(struct xt_error_target));
                (*num)++;
        }
 
@@ -1238,7 +1232,7 @@ static int iptcc_compile_table_prep(struct xtc_handle *h, unsigned int *size)
        /* Append one error rule at end of chain */
        num++;
        offset += sizeof(STRUCT_ENTRY)
-                 + ALIGN(sizeof(struct ipt_error_target));
+                 + ALIGN(sizeof(struct xt_error_target));
 
        /* ruleset size is now in offset */
        *size = offset;
@@ -1261,10 +1255,10 @@ static int iptcc_compile_table(struct xtc_handle *h, STRUCT_REPLACE *repl)
        error = (void *)repl->entries + repl->size - IPTCB_CHAIN_ERROR_SIZE;
        error->entry.target_offset = sizeof(STRUCT_ENTRY);
        error->entry.next_offset = IPTCB_CHAIN_ERROR_SIZE;
-       error->target.t.u.user.target_size =
-               ALIGN(sizeof(struct ipt_error_target));
-       strcpy((char *)&error->target.t.u.user.name, ERROR_TARGET);
-       strcpy((char *)&error->target.error, "ERROR");
+       error->target.target.u.user.target_size =
+               ALIGN(sizeof(struct xt_error_target));
+       strcpy((char *)&error->target.target.u.user.name, ERROR_TARGET);
+       strcpy((char *)&error->target.errorname, "ERROR");
 
        return 1;
 }