From 20a52295775126d1bd5740b6543d1ea8ea239b1b Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Wed, 31 Aug 2011 15:56:34 +0200 Subject: Propagate "expose userspace-relevant parts in ip_set.h" to ipset source With the header file restructuring, the ipset userspace enums IPSET_DIM_* clash with the kernel ones. In this patch the userspace is converted to use the kernel part enums and thus we got rid of userspace enums IPSET_DIM_*. --- lib/print.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/print.c') diff --git a/lib/print.c b/lib/print.c index 6452ab5..96c19a1 100644 --- a/lib/print.c +++ b/lib/print.c @@ -705,30 +705,30 @@ ipset_print_elem(char *buf, unsigned int len, if (!type) return -1; - size = type->elem[IPSET_DIM_ONE].print(buf, len, data, - type->elem[IPSET_DIM_ONE].opt, env); + size = type->elem[IPSET_DIM_ONE - 1].print(buf, len, data, + type->elem[IPSET_DIM_ONE - 1].opt, env); SNPRINTF_FAILURE(size, len, offset); - IF_D(ipset_data_test(data, type->elem[IPSET_DIM_TWO].opt), + IF_D(ipset_data_test(data, type->elem[IPSET_DIM_TWO - 1].opt), "print second elem"); if (type->dimension == IPSET_DIM_ONE || (type->last_elem_optional && - !ipset_data_test(data, type->elem[IPSET_DIM_TWO].opt))) + !ipset_data_test(data, type->elem[IPSET_DIM_TWO - 1].opt))) return offset; size = snprintf(buf + offset, len, IPSET_ELEM_SEPARATOR); SNPRINTF_FAILURE(size, len, offset); - size = type->elem[IPSET_DIM_TWO].print(buf + offset, len, data, - type->elem[IPSET_DIM_TWO].opt, env); + size = type->elem[IPSET_DIM_TWO - 1].print(buf + offset, len, data, + type->elem[IPSET_DIM_TWO - 1].opt, env); SNPRINTF_FAILURE(size, len, offset); if (type->dimension == IPSET_DIM_TWO || (type->last_elem_optional && - !ipset_data_test(data, type->elem[IPSET_DIM_THREE].opt))) + !ipset_data_test(data, type->elem[IPSET_DIM_THREE - 1].opt))) return offset; size = snprintf(buf + offset, len, IPSET_ELEM_SEPARATOR); SNPRINTF_FAILURE(size, len, offset); - size = type->elem[IPSET_DIM_THREE].print(buf + offset, len, data, - type->elem[IPSET_DIM_THREE].opt, env); + size = type->elem[IPSET_DIM_THREE - 1].print(buf + offset, len, data, + type->elem[IPSET_DIM_THREE - 1].opt, env); SNPRINTF_FAILURE(size, len, offset); return offset; -- cgit v1.2.3