Fix CONNMARK mask initialisation This patch fixes the problem that the CONNMARK mask value has been set to 0 whenever the CONNMARK target options were not the last options to be processed. It initalizes the mask value rather than setting it for each parse. Signed-off-by: Peter Warasin --- extensions/libxt_CONNMARK.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) Index: iptables/extensions/libxt_CONNMARK.c =================================================================== --- iptables.orig/extensions/libxt_CONNMARK.c 2008-01-06 03:08:18.000000000 +0100 +++ iptables/extensions/libxt_CONNMARK.c 2008-01-15 12:40:54.000000000 +0100 @@ -64,8 +64,6 @@ struct xt_connmark_target_info *markinfo = (struct xt_connmark_target_info *)(*target)->data; - markinfo->mask = 0xffffffffUL; - switch (c) { char *end; case '1': @@ -188,6 +186,14 @@ } } +static void CONNMARK_init(struct xt_entry_target *t) +{ + struct xt_connmark_target_info *markinfo + = (struct xt_connmark_target_info *)t->data; + + markinfo->mask = 0xffffffffUL; +} + static struct xtables_target connmark_target = { .family = AF_INET, .name = "CONNMARK", @@ -195,6 +201,7 @@ .size = XT_ALIGN(sizeof(struct xt_connmark_target_info)), .userspacesize = XT_ALIGN(sizeof(struct xt_connmark_target_info)), .help = CONNMARK_help, + .init = CONNMARK_init, .parse = CONNMARK_parse, .final_check = CONNMARK_check, .print = CONNMARK_print, @@ -209,6 +216,7 @@ .size = XT_ALIGN(sizeof(struct xt_connmark_target_info)), .userspacesize = XT_ALIGN(sizeof(struct xt_connmark_target_info)), .help = CONNMARK_help, + .init = CONNMARK_init, .parse = CONNMARK_parse, .final_check = CONNMARK_check, .print = CONNMARK_print,