From 1829ed482efbc8b390cc760d012b3a4450494e1a Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 21 Feb 2009 03:29:44 +0100 Subject: libxtables: prefix exit_error to xtables_error Signed-off-by: Jan Engelhardt --- extensions/dscp_helper.c | 4 +-- extensions/libip6t_HL.c | 14 +++++------ extensions/libip6t_LOG.c | 26 ++++++++++---------- extensions/libip6t_REJECT.c | 4 +-- extensions/libip6t_ah.c | 12 ++++----- extensions/libip6t_dst.c | 24 +++++++++--------- extensions/libip6t_frag.c | 18 +++++++------- extensions/libip6t_hbh.c | 24 +++++++++--------- extensions/libip6t_hl.c | 10 ++++---- extensions/libip6t_icmp6.c | 10 ++++---- extensions/libip6t_ipv6header.c | 12 ++++----- extensions/libip6t_mh.c | 6 ++--- extensions/libip6t_policy.c | 52 +++++++++++++++++++-------------------- extensions/libip6t_rt.c | 32 ++++++++++++------------ extensions/libipt_CLUSTERIP.c | 38 ++++++++++++++--------------- extensions/libipt_DNAT.c | 22 ++++++++--------- extensions/libipt_ECN.c | 16 ++++++------ extensions/libipt_LOG.c | 26 ++++++++++---------- extensions/libipt_MASQUERADE.c | 10 ++++---- extensions/libipt_NETMAP.c | 14 +++++------ extensions/libipt_REDIRECT.c | 12 ++++----- extensions/libipt_REJECT.c | 4 +-- extensions/libipt_SAME.c | 14 +++++------ extensions/libipt_SET.c | 10 ++++---- extensions/libipt_SNAT.c | 22 ++++++++--------- extensions/libipt_TTL.c | 14 +++++------ extensions/libipt_ULOG.c | 26 ++++++++++---------- extensions/libipt_addrtype.c | 22 ++++++++--------- extensions/libipt_ah.c | 8 +++--- extensions/libipt_ecn.c | 10 ++++---- extensions/libipt_icmp.c | 8 +++--- extensions/libipt_policy.c | 52 +++++++++++++++++++-------------------- extensions/libipt_realm.c | 6 ++--- extensions/libipt_set.c | 8 +++--- extensions/libipt_set.h | 18 +++++++------- extensions/libipt_ttl.c | 14 +++++------ extensions/libxt_CLASSIFY.c | 6 ++--- extensions/libxt_CONNMARK.c | 20 +++++++-------- extensions/libxt_CONNSECMARK.c | 10 ++++---- extensions/libxt_DSCP.c | 10 ++++---- extensions/libxt_MARK.c | 16 ++++++------ extensions/libxt_NFLOG.c | 24 +++++++++--------- extensions/libxt_NFQUEUE.c | 4 +-- extensions/libxt_RATEEST.c | 20 +++++++-------- extensions/libxt_SECMARK.c | 8 +++--- extensions/libxt_TCPMSS.c | 8 +++--- extensions/libxt_TCPOPTSTRIP.c | 10 ++++---- extensions/libxt_TOS.c | 4 +-- extensions/libxt_TPROXY.c | 2 +- extensions/libxt_comment.c | 6 ++--- extensions/libxt_connbytes.c | 10 ++++---- extensions/libxt_connlimit.c | 10 ++++---- extensions/libxt_connmark.c | 4 +-- extensions/libxt_conntrack.c | 54 ++++++++++++++++++++--------------------- extensions/libxt_dccp.c | 14 +++++------ extensions/libxt_dscp.c | 10 ++++---- extensions/libxt_esp.c | 10 ++++---- extensions/libxt_hashlimit.c | 32 ++++++++++++------------ extensions/libxt_helper.c | 4 +-- extensions/libxt_iprange.c | 10 ++++---- extensions/libxt_length.c | 8 +++--- extensions/libxt_limit.c | 10 ++++---- extensions/libxt_mac.c | 6 ++--- extensions/libxt_mark.c | 4 +-- extensions/libxt_multiport.c | 26 ++++++++++---------- extensions/libxt_owner.c | 4 +-- extensions/libxt_physdev.c | 4 +-- extensions/libxt_pkttype.c | 4 +-- extensions/libxt_quota.c | 6 ++--- extensions/libxt_rateest.c | 44 ++++++++++++++++----------------- extensions/libxt_recent.c | 12 ++++----- extensions/libxt_sctp.c | 18 +++++++------- extensions/libxt_state.c | 8 +++--- extensions/libxt_statistic.c | 32 ++++++++++++------------ extensions/libxt_string.c | 38 ++++++++++++++--------------- extensions/libxt_tcp.c | 18 +++++++------- extensions/libxt_tcpmss.c | 6 ++--- extensions/libxt_time.c | 36 +++++++++++++-------------- extensions/libxt_tos.c | 4 +-- extensions/libxt_u32.c | 30 +++++++++++------------ extensions/libxt_udp.c | 6 ++--- extensions/tos_values.c | 6 ++--- 82 files changed, 629 insertions(+), 629 deletions(-) (limited to 'extensions') diff --git a/extensions/dscp_helper.c b/extensions/dscp_helper.c index 217df099..8fa0f4a0 100644 --- a/extensions/dscp_helper.c +++ b/extensions/dscp_helper.c @@ -57,7 +57,7 @@ class_to_dscp(const char *name) return ds_classes[i].dscp; } - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid DSCP value `%s'\n", name); } @@ -74,7 +74,7 @@ dscp_to_name(unsigned int dscp) } - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid DSCP value `%d'\n", dscp); } #endif diff --git a/extensions/libip6t_HL.c b/extensions/libip6t_HL.c index 0a987139..ee117f14 100644 --- a/extensions/libip6t_HL.c +++ b/extensions/libip6t_HL.c @@ -32,20 +32,20 @@ static int HL_parse(int c, char **argv, int invert, unsigned int *flags, unsigned int value; if (*flags & IP6T_HL_USED) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify HL option twice"); } if (!optarg) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "HL: You must specify a value"); if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "HL: unexpected `!'"); if (!xtables_strtoui(optarg, NULL, &value, 0, UINT8_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "HL: Expected value between 0 and 255"); switch (c) { @@ -56,7 +56,7 @@ static int HL_parse(int c, char **argv, int invert, unsigned int *flags, case '2': if (value == 0) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "HL: decreasing by 0?"); } @@ -65,7 +65,7 @@ static int HL_parse(int c, char **argv, int invert, unsigned int *flags, case '3': if (value == 0) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "HL: increasing by 0?"); } @@ -86,7 +86,7 @@ static int HL_parse(int c, char **argv, int invert, unsigned int *flags, static void HL_check(unsigned int flags) { if (!(flags & IP6T_HL_USED)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "HL: You must specify an action"); } diff --git a/extensions/libip6t_LOG.c b/extensions/libip6t_LOG.c index 79877350..c6bf2a79 100644 --- a/extensions/libip6t_LOG.c +++ b/extensions/libip6t_LOG.c @@ -79,7 +79,7 @@ parse_level(const char *level) if (strncasecmp(level, ip6t_log_names[i].name, strlen(level)) == 0) { if (set++) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "log-level `%s' ambiguous", level); lev = ip6t_log_names[i].level; @@ -87,7 +87,7 @@ parse_level(const char *level) } if (!set) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "log-level `%s' unknown", level); } @@ -109,11 +109,11 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '!': if (*flags & IP6T_LOG_OPT_LEVEL) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --log-level twice"); if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --log-level"); loginfo->level = parse_level(optarg); @@ -122,24 +122,24 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags, case '#': if (*flags & IP6T_LOG_OPT_PREFIX) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --log-prefix twice"); if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --log-prefix"); if (strlen(optarg) > sizeof(loginfo->prefix) - 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Maximum prefix length %u for --log-prefix", (unsigned int)sizeof(loginfo->prefix) - 1); if (strlen(optarg) == 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "No prefix specified for --log-prefix"); if (strlen(optarg) != strlen(strtok(optarg, "\n"))) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Newlines not allowed in --log-prefix"); strcpy(loginfo->prefix, optarg); @@ -148,7 +148,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags, case '1': if (*flags & IP6T_LOG_OPT_TCPSEQ) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --log-tcp-sequence " "twice"); @@ -158,7 +158,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags, case '2': if (*flags & IP6T_LOG_OPT_TCPOPT) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --log-tcp-options twice"); loginfo->logflags |= IP6T_LOG_TCPOPT; @@ -167,7 +167,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags, case '3': if (*flags & IP6T_LOG_OPT_IPOPT) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --log-ip-options twice"); loginfo->logflags |= IP6T_LOG_IPOPT; @@ -176,7 +176,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags, case '4': if (*flags & IP6T_LOG_OPT_UID) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --log-uid twice"); loginfo->logflags |= IP6T_LOG_UID; diff --git a/extensions/libip6t_REJECT.c b/extensions/libip6t_REJECT.c index 1c2be686..94013eca 100644 --- a/extensions/libip6t_REJECT.c +++ b/extensions/libip6t_REJECT.c @@ -86,7 +86,7 @@ static int REJECT_parse(int c, char **argv, int invert, unsigned int *flags, switch(c) { case '1': if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --reject-with"); for (i = 0; i < limit; i++) { if ((strncasecmp(reject_table[i].name, optarg, strlen(optarg)) == 0) @@ -95,7 +95,7 @@ static int REJECT_parse(int c, char **argv, int invert, unsigned int *flags, return 1; } } - exit_error(PARAMETER_PROBLEM, "unknown reject type `%s'",optarg); + xtables_error(PARAMETER_PROBLEM, "unknown reject type \"%s\"", optarg); default: /* Fall through */ break; diff --git a/extensions/libip6t_ah.c b/extensions/libip6t_ah.c index 83ed4514..19b7ad46 100644 --- a/extensions/libip6t_ah.c +++ b/extensions/libip6t_ah.c @@ -33,16 +33,16 @@ parse_ah_spi(const char *spistr, const char *typestr) spi = strtoul(spistr, &ep, 0); if ( spistr == ep ) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "AH no valid digits in %s `%s'", typestr, spistr); if ( spi == ULONG_MAX && errno == ERANGE ) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "%s `%s' specified too big: would overflow", typestr, spistr); if ( *spistr != '\0' && *ep != '\0' ) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "AH error parsing %s `%s'", typestr, spistr); return spi; @@ -84,7 +84,7 @@ static int ah_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags & IP6T_AH_SPI) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--ahspi' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_ah_spis(argv[optind-1], ahinfo->spis); @@ -94,7 +94,7 @@ static int ah_parse(int c, char **argv, int invert, unsigned int *flags, break; case '2': if (*flags & IP6T_AH_LEN) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--ahlen' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); ahinfo->hdrlen = parse_ah_spi(argv[optind-1], "length"); @@ -104,7 +104,7 @@ static int ah_parse(int c, char **argv, int invert, unsigned int *flags, break; case '3': if (*flags & IP6T_AH_RES) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--ahres' allowed"); ahinfo->hdrres = 1; *flags |= IP6T_AH_RES; diff --git a/extensions/libip6t_dst.c b/extensions/libip6t_dst.c index e19abc4b..a47e3a35 100644 --- a/extensions/libip6t_dst.c +++ b/extensions/libip6t_dst.c @@ -37,16 +37,16 @@ parse_opts_num(const char *idstr, const char *typestr) id = strtoul(idstr, &ep, 0); if ( idstr == ep ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "dst: no valid digits in %s `%s'", typestr, idstr); } if ( id == ULONG_MAX && errno == ERANGE ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "%s `%s' specified too big: would overflow", typestr, idstr); } if ( *idstr != '\0' && *ep != '\0' ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "dst: error parsing %s `%s'", typestr, idstr); } return id; @@ -60,7 +60,7 @@ parse_options(const char *optsstr, u_int16_t *opts) buffer = strdup(optsstr); if (!buffer) - exit_error(OTHER_PROBLEM, "strdup failed"); + xtables_error(OTHER_PROBLEM, "strdup failed"); for (cp = buffer, i = 0; cp && i < IP6T_OPTS_OPTSNR; cp = next, i++) { @@ -73,7 +73,7 @@ parse_options(const char *optsstr, u_int16_t *opts) if (range) { if (i == IP6T_OPTS_OPTSNR-1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "too many ports specified"); *range++ = '\0'; } @@ -81,7 +81,7 @@ parse_options(const char *optsstr, u_int16_t *opts) opts[i] = (parse_opts_num(cp, "opt") & 0xFF) << 8; if (range) { if (opts[i] == 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "PAD0 hasn't got length"); opts[i] |= parse_opts_num(range, "length") & 0xFF; } else @@ -94,7 +94,7 @@ parse_options(const char *optsstr, u_int16_t *opts) } if (cp) - exit_error(PARAMETER_PROBLEM, "too many addresses specified"); + xtables_error(PARAMETER_PROBLEM, "too many addresses specified"); free(buffer); @@ -123,7 +123,7 @@ static int dst_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags & IP6T_OPTS_LEN) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--dst-len' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); optinfo->hdrlen = parse_opts_num(argv[optind-1], "length"); @@ -134,11 +134,11 @@ static int dst_parse(int c, char **argv, int invert, unsigned int *flags, break; case '2': if (*flags & IP6T_OPTS_OPTS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--dst-opts' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, " '!' not allowed with `--dst-opts'"); optinfo->optsnr = parse_options(argv[optind-1], optinfo->opts); optinfo->flags |= IP6T_OPTS_OPTS; @@ -146,10 +146,10 @@ static int dst_parse(int c, char **argv, int invert, unsigned int *flags, break; case '3': if (*flags & IP6T_OPTS_NSTRICT) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--dst-not-strict' allowed"); if ( !(*flags & IP6T_OPTS_OPTS) ) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "`--dst-opts ...' required before " "`--dst-not-strict'"); optinfo->flags |= IP6T_OPTS_NSTRICT; diff --git a/extensions/libip6t_frag.c b/extensions/libip6t_frag.c index b55ef26f..905b494b 100644 --- a/extensions/libip6t_frag.c +++ b/extensions/libip6t_frag.c @@ -39,16 +39,16 @@ parse_frag_id(const char *idstr, const char *typestr) id = strtoul(idstr, &ep, 0); if ( idstr == ep ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "FRAG no valid digits in %s `%s'", typestr, idstr); } if ( id == ULONG_MAX && errno == ERANGE ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "%s `%s' specified too big: would overflow", typestr, idstr); } if ( *idstr != '\0' && *ep != '\0' ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "FRAG error parsing %s `%s'", typestr, idstr); } return id; @@ -92,7 +92,7 @@ static int frag_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags & IP6T_FRAG_IDS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--fragid' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_frag_ids(argv[optind-1], fraginfo->ids); @@ -103,7 +103,7 @@ static int frag_parse(int c, char **argv, int invert, unsigned int *flags, break; case '2': if (*flags & IP6T_FRAG_LEN) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--fraglen' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); fraginfo->hdrlen = parse_frag_id(argv[optind-1], "length"); @@ -114,28 +114,28 @@ static int frag_parse(int c, char **argv, int invert, unsigned int *flags, break; case '3': if (*flags & IP6T_FRAG_RES) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--fragres' allowed"); fraginfo->flags |= IP6T_FRAG_RES; *flags |= IP6T_FRAG_RES; break; case '4': if (*flags & IP6T_FRAG_FST) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--fragfirst' allowed"); fraginfo->flags |= IP6T_FRAG_FST; *flags |= IP6T_FRAG_FST; break; case '5': if (*flags & (IP6T_FRAG_MF|IP6T_FRAG_NMF)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--fragmore' or `--fraglast' allowed"); fraginfo->flags |= IP6T_FRAG_MF; *flags |= IP6T_FRAG_MF; break; case '6': if (*flags & (IP6T_FRAG_MF|IP6T_FRAG_NMF)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--fragmore' or `--fraglast' allowed"); fraginfo->flags |= IP6T_FRAG_NMF; *flags |= IP6T_FRAG_NMF; diff --git a/extensions/libip6t_hbh.c b/extensions/libip6t_hbh.c index 3354eae4..e08d84a2 100644 --- a/extensions/libip6t_hbh.c +++ b/extensions/libip6t_hbh.c @@ -40,16 +40,16 @@ parse_opts_num(const char *idstr, const char *typestr) id = strtoul(idstr,&ep,0) ; if ( idstr == ep ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "hbh: no valid digits in %s `%s'", typestr, idstr); } if ( id == ULONG_MAX && errno == ERANGE ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "%s `%s' specified too big: would overflow", typestr, idstr); } if ( *idstr != '\0' && *ep != '\0' ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "hbh: error parsing %s `%s'", typestr, idstr); } return id; @@ -62,7 +62,7 @@ parse_options(const char *optsstr, u_int16_t *opts) unsigned int i; buffer = strdup(optsstr); - if (!buffer) exit_error(OTHER_PROBLEM, "strdup failed"); + if (!buffer) xtables_error(OTHER_PROBLEM, "strdup failed"); for (cp=buffer, i=0; cp && ihdrlen = parse_opts_num(argv[optind-1], "length"); @@ -129,11 +129,11 @@ static int hbh_parse(int c, char **argv, int invert, unsigned int *flags, break; case '2': if (*flags & IP6T_OPTS_OPTS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--hbh-opts' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, " '!' not allowed with `--hbh-opts'"); optinfo->optsnr = parse_options(argv[optind-1], optinfo->opts); optinfo->flags |= IP6T_OPTS_OPTS; @@ -141,10 +141,10 @@ static int hbh_parse(int c, char **argv, int invert, unsigned int *flags, break; case '3': if (*flags & IP6T_OPTS_NSTRICT) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--hbh-not-strict' allowed"); if ( !(*flags & IP6T_OPTS_OPTS) ) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "`--hbh-opts ...' required before `--hbh-not-strict'"); optinfo->flags |= IP6T_OPTS_NSTRICT; *flags |= IP6T_OPTS_NSTRICT; diff --git a/extensions/libip6t_hl.c b/extensions/libip6t_hl.c index 286f4324..2280e03e 100644 --- a/extensions/libip6t_hl.c +++ b/extensions/libip6t_hl.c @@ -34,11 +34,11 @@ static int hl_parse(int c, char **argv, int invert, unsigned int *flags, value = atoi(argv[optind-1]); if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify HL option twice"); if (!optarg) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "hl: You must specify a value"); switch (c) { case '2': @@ -54,7 +54,7 @@ static int hl_parse(int c, char **argv, int invert, unsigned int *flags, break; case '3': if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "hl: unexpected `!'"); info->mode = IP6T_HL_LT; @@ -64,7 +64,7 @@ static int hl_parse(int c, char **argv, int invert, unsigned int *flags, break; case '4': if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "hl: unexpected `!'"); info->mode = IP6T_HL_GT; @@ -82,7 +82,7 @@ static int hl_parse(int c, char **argv, int invert, unsigned int *flags, static void hl_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "HL match: You must specify one of " "`--hl-eq', `--hl-lt', `--hl-gt'"); } diff --git a/extensions/libip6t_icmp6.c b/extensions/libip6t_icmp6.c index 5af9b02e..69171d1a 100644 --- a/extensions/libip6t_icmp6.c +++ b/extensions/libip6t_icmp6.c @@ -98,7 +98,7 @@ parse_icmpv6(const char *icmpv6type, u_int8_t *type, u_int8_t code[]) if (strncasecmp(icmpv6_codes[i].name, icmpv6type, strlen(icmpv6type)) == 0) { if (match != limit) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Ambiguous ICMPv6 type `%s':" " `%s' or `%s'?", icmpv6type, @@ -124,12 +124,12 @@ parse_icmpv6(const char *icmpv6type, u_int8_t *type, u_int8_t code[]) *slash = '\0'; if (!xtables_strtoui(buffer, NULL, &number, 0, UINT8_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid ICMPv6 type `%s'\n", buffer); *type = number; if (slash) { if (!xtables_strtoui(slash+1, NULL, &number, 0, UINT8_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid ICMPv6 code `%s'\n", slash+1); code[0] = code[1] = number; @@ -155,7 +155,7 @@ static int icmp6_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags == 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "icmpv6 match: only use --icmpv6-type once!"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_icmpv6(argv[optind-1], &icmpv6info->type, @@ -240,7 +240,7 @@ static void icmp6_save(const void *ip, const struct xt_entry_match *match) static void icmp6_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "icmpv6 match: You must specify `--icmpv6-type'"); } diff --git a/extensions/libip6t_ipv6header.c b/extensions/libip6t_ipv6header.c index 982e6a7b..296bd5f3 100644 --- a/extensions/libip6t_ipv6header.c +++ b/extensions/libip6t_ipv6header.c @@ -105,7 +105,7 @@ name_to_proto(const char *s) } if (i == sizeof(chain_protos)/sizeof(struct pprot)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "unknown header `%s' specified", s); } @@ -127,7 +127,7 @@ add_proto_to_mask(int proto){ } if (i == sizeof(chain_flags)/sizeof(struct numflag)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "unknown header `%d' specified", proto); @@ -189,13 +189,13 @@ ipv6header_parse(int c, char **argv, int invert, unsigned int *flags, case '1' : /* Parse the provided header names */ if (*flags & IPV6_HDR_HEADER) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--header' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); if (! (info->matchflags = parse_header(argv[optind-1])) ) - exit_error(PARAMETER_PROBLEM, "ip6t_ipv6header: cannot parse header names"); + xtables_error(PARAMETER_PROBLEM, "ip6t_ipv6header: cannot parse header names"); if (invert) info->invflags |= 0xFF; @@ -204,7 +204,7 @@ ipv6header_parse(int c, char **argv, int invert, unsigned int *flags, case '2' : /* Soft-mode requested? */ if (*flags & IPV6_HDR_SOFT) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--soft' allowed"); info->modeflag |= 0xFF; @@ -219,7 +219,7 @@ ipv6header_parse(int c, char **argv, int invert, unsigned int *flags, static void ipv6header_check(unsigned int flags) { - if (!flags) exit_error(PARAMETER_PROBLEM, "ip6t_ipv6header: no options specified"); + if (!flags) xtables_error(PARAMETER_PROBLEM, "ip6t_ipv6header: no options specified"); } static void diff --git a/extensions/libip6t_mh.c b/extensions/libip6t_mh.c index 78fc804a..f476c93e 100644 --- a/extensions/libip6t_mh.c +++ b/extensions/libip6t_mh.c @@ -94,7 +94,7 @@ static unsigned int name_to_type(const char *name) unsigned int number; if (!xtables_strtoui(name, NULL, &number, 0, UINT8_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid MH type `%s'\n", name); return number; } @@ -116,7 +116,7 @@ static void parse_mh_types(const char *mhtype, u_int8_t *types) types[1] = cp[0] ? name_to_type(cp) : 0xFF; if (types[0] > types[1]) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid MH type range (min > max)"); } free(buffer); @@ -132,7 +132,7 @@ static int mh_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags & MH_TYPES) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--mh-type' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_mh_types(argv[optind-1], mhinfo->types); diff --git a/extensions/libip6t_policy.c b/extensions/libip6t_policy.c index 7ea72cd9..70f320fa 100644 --- a/extensions/libip6t_policy.c +++ b/extensions/libip6t_policy.c @@ -130,7 +130,7 @@ static int parse_direction(char *s) return IP6T_POLICY_MATCH_IN; if (strcmp(s, "out") == 0) return IP6T_POLICY_MATCH_OUT; - exit_error(PARAMETER_PROBLEM, "policy_match: invalid dir `%s'", s); + xtables_error(PARAMETER_PROBLEM, "policy_match: invalid dir \"%s\"", s); } static int parse_policy(char *s) @@ -139,7 +139,7 @@ static int parse_policy(char *s) return IP6T_POLICY_MATCH_NONE; if (strcmp(s, "ipsec") == 0) return 0; - exit_error(PARAMETER_PROBLEM, "policy match: invalid policy `%s'", s); + xtables_error(PARAMETER_PROBLEM, "policy match: invalid policy \"%s\"", s); } static int parse_mode(char *s) @@ -148,7 +148,7 @@ static int parse_mode(char *s) return IP6T_POLICY_MODE_TRANSPORT; if (strcmp(s, "tunnel") == 0) return IP6T_POLICY_MODE_TUNNEL; - exit_error(PARAMETER_PROBLEM, "policy match: invalid mode `%s'", s); + xtables_error(PARAMETER_PROBLEM, "policy match: invalid mode \"%s\"", s); } static int policy_parse(int c, char **argv, int invert, unsigned int *flags, @@ -165,35 +165,35 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (info->flags & (IP6T_POLICY_MATCH_IN|IP6T_POLICY_MATCH_OUT)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: double --dir option"); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: can't invert --dir option"); info->flags |= parse_direction(argv[optind-1]); break; case '2': if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: can't invert --policy option"); info->flags |= parse_policy(argv[optind-1]); break; case '3': if (info->flags & IP6T_POLICY_MATCH_STRICT) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: double --strict option"); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: can't invert --strict option"); info->flags |= IP6T_POLICY_MATCH_STRICT; break; case '4': if (e->match.reqid) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: double --reqid option"); e->match.reqid = 1; @@ -202,7 +202,7 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags, break; case '5': if (e->match.spi) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: double --spi option"); e->match.spi = 1; @@ -211,12 +211,12 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags, break; case '6': if (e->match.saddr) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: double --tunnel-src option"); xtables_ip6parse_any(argv[optind-1], &addr, &mask, &naddr); if (naddr > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: name resolves to multiple IPs"); e->match.saddr = 1; @@ -226,12 +226,12 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags, break; case '7': if (e->match.daddr) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: double --tunnel-dst option"); xtables_ip6parse_any(argv[optind-1], &addr, &mask, &naddr); if (naddr > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: name resolves to multiple IPs"); e->match.daddr = 1; @@ -241,20 +241,20 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags, break; case '8': if (e->match.proto) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: double --proto option"); e->proto = xtables_parse_protocol(argv[optind-1]); if (e->proto != IPPROTO_AH && e->proto != IPPROTO_ESP && e->proto != IPPROTO_COMP) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: protocol must ah/esp/ipcomp"); e->match.proto = 1; e->invert.proto = invert; break; case '9': if (e->match.mode) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: double --mode option"); mode = parse_mode(argv[optind-1]); @@ -264,11 +264,11 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags, break; case 'a': if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: can't invert --next option"); if (++info->len == IP6T_POLICY_MAX_ELEM) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: maximum policy depth reached"); break; default: @@ -286,26 +286,26 @@ static void policy_check(unsigned int flags) int i; if (info == NULL) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: no parameters given"); if (!(info->flags & (IP6T_POLICY_MATCH_IN|IP6T_POLICY_MATCH_OUT))) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: neither --in nor --out specified"); if (info->flags & IP6T_POLICY_MATCH_NONE) { if (info->flags & IP6T_POLICY_MATCH_STRICT) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: policy none but --strict given"); if (info->len != 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: policy none but policy given"); } else info->len++; /* increase len by 1, no --next after last element */ if (!(info->flags & IP6T_POLICY_MATCH_STRICT) && info->len > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: multiple elements but no --strict"); for (i = 0; i < info->len; i++) { @@ -314,13 +314,13 @@ static void policy_check(unsigned int flags) if (info->flags & IP6T_POLICY_MATCH_STRICT && !(e->match.reqid || e->match.spi || e->match.saddr || e->match.daddr || e->match.proto || e->match.mode)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: empty policy element"); if ((e->match.saddr || e->match.daddr) && ((e->mode == IP6T_POLICY_MODE_TUNNEL && e->invert.mode) || (e->mode == IP6T_POLICY_MODE_TRANSPORT && !e->invert.mode))) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: --tunnel-src/--tunnel-dst " "is only valid in tunnel mode"); } diff --git a/extensions/libip6t_rt.c b/extensions/libip6t_rt.c index 64c98efc..c9bf9945 100644 --- a/extensions/libip6t_rt.c +++ b/extensions/libip6t_rt.c @@ -46,16 +46,16 @@ parse_rt_num(const char *idstr, const char *typestr) id = strtoul(idstr,&ep,0) ; if ( idstr == ep ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "RT no valid digits in %s `%s'", typestr, idstr); } if ( id == ULONG_MAX && errno == ERANGE ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "%s `%s' specified too big: would overflow", typestr, idstr); } if ( *idstr != '\0' && *ep != '\0' ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "RT error parsing %s `%s'", typestr, idstr); } return id; @@ -98,7 +98,7 @@ numeric_to_addr(const char *num) #ifdef DEBUG fprintf(stderr, "\nnumeric2addr: %d\n", err); #endif - exit_error(PARAMETER_PROBLEM, "bad address: %s", num); + xtables_error(PARAMETER_PROBLEM, "bad address: %s", num); return (struct in6_addr *)NULL; } @@ -111,7 +111,7 @@ parse_addresses(const char *addrstr, struct in6_addr *addrp) unsigned int i; buffer = strdup(addrstr); - if (!buffer) exit_error(OTHER_PROBLEM, "strdup failed"); + if (!buffer) xtables_error(OTHER_PROBLEM, "strdup failed"); for (cp=buffer, i=0; cp && irt_type = parse_rt_num(argv[optind-1], "type"); @@ -167,7 +167,7 @@ static int rt_parse(int c, char **argv, int invert, unsigned int *flags, break; case '2': if (*flags & IP6T_RT_SGS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--rt-segsleft' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_rt_segsleft(argv[optind-1], rtinfo->segsleft); @@ -178,7 +178,7 @@ static int rt_parse(int c, char **argv, int invert, unsigned int *flags, break; case '3': if (*flags & IP6T_RT_LEN) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--rt-len' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); rtinfo->hdrlen = parse_rt_num(argv[optind-1], "length"); @@ -189,24 +189,24 @@ static int rt_parse(int c, char **argv, int invert, unsigned int *flags, break; case '4': if (*flags & IP6T_RT_RES) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--rt-0-res' allowed"); if ( !(*flags & IP6T_RT_TYP) || (rtinfo->rt_type != 0) || (rtinfo->invflags & IP6T_RT_INV_TYP) ) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "`--rt-type 0' required before `--rt-0-res'"); rtinfo->flags |= IP6T_RT_RES; *flags |= IP6T_RT_RES; break; case '5': if (*flags & IP6T_RT_FST) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--rt-0-addrs' allowed"); if ( !(*flags & IP6T_RT_TYP) || (rtinfo->rt_type != 0) || (rtinfo->invflags & IP6T_RT_INV_TYP) ) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "`--rt-type 0' required before `--rt-0-addrs'"); xtables_check_inverse(optarg, &invert, &optind, 0); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, " '!' not allowed with `--rt-0-addrs'"); rtinfo->addrnr = parse_addresses(argv[optind-1], rtinfo->addrs); rtinfo->flags |= IP6T_RT_FST; @@ -214,10 +214,10 @@ static int rt_parse(int c, char **argv, int invert, unsigned int *flags, break; case '6': if (*flags & IP6T_RT_FST_NSTRICT) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--rt-0-not-strict' allowed"); if ( !(*flags & IP6T_RT_FST) ) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "`--rt-0-addr ...' required before `--rt-0-not-strict'"); rtinfo->flags |= IP6T_RT_FST_NSTRICT; *flags |= IP6T_RT_FST_NSTRICT; diff --git a/extensions/libipt_CLUSTERIP.c b/extensions/libipt_CLUSTERIP.c index 38909ea4..2bb2292a 100644 --- a/extensions/libipt_CLUSTERIP.c +++ b/extensions/libipt_CLUSTERIP.c @@ -57,7 +57,7 @@ parse_mac(const char *mac, char *macbuf) unsigned int i = 0; if (strlen(mac) != ETH_ALEN*3-1) - exit_error(PARAMETER_PROBLEM, "Bad mac address `%s'", mac); + xtables_error(PARAMETER_PROBLEM, "Bad mac address \"%s\"", mac); for (i = 0; i < ETH_ALEN; i++) { long number; @@ -70,7 +70,7 @@ parse_mac(const char *mac, char *macbuf) && number <= 255) macbuf[i] = number; else - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Bad mac address `%s'", mac); } } @@ -86,14 +86,14 @@ static int CLUSTERIP_parse(int c, char **argv, int invert, unsigned int *flags, case '1': cipinfo->flags |= CLUSTERIP_FLAG_NEW; if (*flags & PARAM_NEW) - exit_error(PARAMETER_PROBLEM, "Can only specify `--new' once\n"); + xtables_error(PARAMETER_PROBLEM, "Can only specify \"--new\" once\n"); *flags |= PARAM_NEW; break; case '2': if (!(*flags & PARAM_NEW)) - exit_error(PARAMETER_PROBLEM, "Can only specify hashmode combined with `--new'\n"); + xtables_error(PARAMETER_PROBLEM, "Can only specify hashmode combined with \"--new\"\n"); if (*flags & PARAM_HMODE) - exit_error(PARAMETER_PROBLEM, "Can only specify hashmode once\n"); + xtables_error(PARAMETER_PROBLEM, "Can only specify hashmode once\n"); if (!strcmp(optarg, "sourceip")) cipinfo->hash_mode = CLUSTERIP_HASHMODE_SIP; else if (!strcmp(optarg, "sourceip-sourceport")) @@ -101,48 +101,48 @@ static int CLUSTERIP_parse(int c, char **argv, int invert, unsigned int *flags, else if (!strcmp(optarg, "sourceip-sourceport-destport")) cipinfo->hash_mode = CLUSTERIP_HASHMODE_SIP_SPT_DPT; else - exit_error(PARAMETER_PROBLEM, "Unknown hashmode `%s'\n", + xtables_error(PARAMETER_PROBLEM, "Unknown hashmode \"%s\"\n", optarg); *flags |= PARAM_HMODE; break; case '3': if (!(*flags & PARAM_NEW)) - exit_error(PARAMETER_PROBLEM, "Can only specify MAC combined with `--new'\n"); + xtables_error(PARAMETER_PROBLEM, "Can only specify MAC combined with \"--new\"\n"); if (*flags & PARAM_MAC) - exit_error(PARAMETER_PROBLEM, "Can only specify MAC once\n"); + xtables_error(PARAMETER_PROBLEM, "Can only specify MAC once\n"); parse_mac(optarg, (char *)cipinfo->clustermac); if (!(cipinfo->clustermac[0] & 0x01)) - exit_error(PARAMETER_PROBLEM, "MAC has to be a multicast ethernet address\n"); + xtables_error(PARAMETER_PROBLEM, "MAC has to be a multicast ethernet address\n"); *flags |= PARAM_MAC; break; case '4': if (!(*flags & PARAM_NEW)) - exit_error(PARAMETER_PROBLEM, "Can only specify node number combined with `--new'\n"); + xtables_error(PARAMETER_PROBLEM, "Can only specify node number combined with \"--new\"\n"); if (*flags & PARAM_TOTALNODE) - exit_error(PARAMETER_PROBLEM, "Can only specify total node number once\n"); + xtables_error(PARAMETER_PROBLEM, "Can only specify total node number once\n"); if (!xtables_strtoui(optarg, NULL, &num, 1, CLUSTERIP_MAX_NODES)) - exit_error(PARAMETER_PROBLEM, "Unable to parse `%s'\n", optarg); + xtables_error(PARAMETER_PROBLEM, "Unable to parse \"%s\"\n", optarg); cipinfo->num_total_nodes = num; *flags |= PARAM_TOTALNODE; break; case '5': if (!(*flags & PARAM_NEW)) - exit_error(PARAMETER_PROBLEM, "Can only specify node number combined with `--new'\n"); + xtables_error(PARAMETER_PROBLEM, "Can only specify node number combined with \"--new\"\n"); if (*flags & PARAM_LOCALNODE) - exit_error(PARAMETER_PROBLEM, "Can only specify local node number once\n"); + xtables_error(PARAMETER_PROBLEM, "Can only specify local node number once\n"); if (!xtables_strtoui(optarg, NULL, &num, 1, CLUSTERIP_MAX_NODES)) - exit_error(PARAMETER_PROBLEM, "Unable to parse `%s'\n", optarg); + xtables_error(PARAMETER_PROBLEM, "Unable to parse \"%s\"\n", optarg); cipinfo->num_local_nodes = 1; cipinfo->local_nodes[0] = num; *flags |= PARAM_LOCALNODE; break; case '6': if (!(*flags & PARAM_NEW)) - exit_error(PARAMETER_PROBLEM, "Can only specify hash init value combined with `--new'\n"); + xtables_error(PARAMETER_PROBLEM, "Can only specify hash init value combined with \"--new\"\n"); if (*flags & PARAM_HASHINIT) - exit_error(PARAMETER_PROBLEM, "Can specify hash init value only once\n"); + xtables_error(PARAMETER_PROBLEM, "Can specify hash init value only once\n"); if (!xtables_strtoui(optarg, NULL, &num, 0, UINT_MAX)) - exit_error(PARAMETER_PROBLEM, "Unable to parse `%s'\n", optarg); + xtables_error(PARAMETER_PROBLEM, "Unable to parse \"%s\"\n", optarg); cipinfo->hash_initval = num; *flags |= PARAM_HASHINIT; break; @@ -162,7 +162,7 @@ static void CLUSTERIP_check(unsigned int flags) == (PARAM_NEW|PARAM_HMODE|PARAM_MAC|PARAM_TOTALNODE|PARAM_LOCALNODE)) return; - exit_error(PARAMETER_PROBLEM, "CLUSTERIP target: Invalid parameter combination\n"); + xtables_error(PARAMETER_PROBLEM, "CLUSTERIP target: Invalid parameter combination\n"); } static char *hashmode2str(enum clusterip_hashmode mode) diff --git a/extensions/libipt_DNAT.c b/extensions/libipt_DNAT.c index 371ec79a..a3e14622 100644 --- a/extensions/libipt_DNAT.c +++ b/extensions/libipt_DNAT.c @@ -45,7 +45,7 @@ append_range(struct ipt_natinfo *info, const struct ip_nat_range *range) info = realloc(info, size); if (!info) - exit_error(OTHER_PROBLEM, "Out of memory\n"); + xtables_error(OTHER_PROBLEM, "Out of memory\n"); info->t.u.target_size = size; info->mr.range[info->mr.rangesize] = *range; @@ -69,19 +69,19 @@ parse_to(char *arg, int portok, struct ipt_natinfo *info) int port; if (!portok) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Need TCP, UDP, SCTP or DCCP with port specification"); range.flags |= IP_NAT_RANGE_PROTO_SPECIFIED; port = atoi(colon+1); if (port <= 0 || port > 65535) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Port `%s' not valid\n", colon+1); error = strchr(colon+1, ':'); if (error) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid port:port syntax - use dash\n"); dash = strchr(colon, '-'); @@ -94,11 +94,11 @@ parse_to(char *arg, int portok, struct ipt_natinfo *info) maxport = atoi(dash + 1); if (maxport <= 0 || maxport > 65535) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Port `%s' not valid\n", dash+1); if (maxport < port) /* People are stupid. */ - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Port range `%s' funky\n", colon+1); range.min.tcp.port = htons(port); range.max.tcp.port = htons(maxport); @@ -119,13 +119,13 @@ parse_to(char *arg, int portok, struct ipt_natinfo *info) ip = xtables_numeric_to_ipaddr(arg); if (!ip) - exit_error(PARAMETER_PROBLEM, "Bad IP address `%s'\n", + xtables_error(PARAMETER_PROBLEM, "Bad IP address \"%s\"\n", arg); range.min_ip = ip->s_addr; if (dash) { ip = xtables_numeric_to_ipaddr(dash+1); if (!ip) - exit_error(PARAMETER_PROBLEM, "Bad IP address `%s'\n", + xtables_error(PARAMETER_PROBLEM, "Bad IP address \"%s\"\n", dash+1); range.max_ip = ip->s_addr; } else @@ -153,14 +153,14 @@ static int DNAT_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --to-destination"); if (*flags) { if (!kernel_version) get_kernel_version(); if (kernel_version > LINUX_VERSION(2, 6, 10)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Multiple --to-destination not supported"); } *target = parse_to(optarg, portok, info); @@ -185,7 +185,7 @@ static int DNAT_parse(int c, char **argv, int invert, unsigned int *flags, static void DNAT_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "You must specify --to-destination"); } diff --git a/extensions/libipt_ECN.c b/extensions/libipt_ECN.c index c4e8e34f..b107d16e 100644 --- a/extensions/libipt_ECN.c +++ b/extensions/libipt_ECN.c @@ -50,7 +50,7 @@ static int ECN_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case 'F': if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ECN target: Only use --ecn-tcp-remove ONCE!"); einfo->operation = IPT_ECN_OP_SET_ECE | IPT_ECN_OP_SET_CWR; einfo->proto.tcp.ece = 0; @@ -59,10 +59,10 @@ static int ECN_parse(int c, char **argv, int invert, unsigned int *flags, break; case 'G': if (*flags & IPT_ECN_OP_SET_CWR) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ECN target: Only use --ecn-tcp-cwr ONCE!"); if (!xtables_strtoui(optarg, NULL, &result, 0, 1)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ECN target: Value out of range"); einfo->operation |= IPT_ECN_OP_SET_CWR; einfo->proto.tcp.cwr = result; @@ -70,10 +70,10 @@ static int ECN_parse(int c, char **argv, int invert, unsigned int *flags, break; case 'H': if (*flags & IPT_ECN_OP_SET_ECE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ECN target: Only use --ecn-tcp-ece ONCE!"); if (!xtables_strtoui(optarg, NULL, &result, 0, 1)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ECN target: Value out of range"); einfo->operation |= IPT_ECN_OP_SET_ECE; einfo->proto.tcp.ece = result; @@ -81,10 +81,10 @@ static int ECN_parse(int c, char **argv, int invert, unsigned int *flags, break; case '9': if (*flags & IPT_ECN_OP_SET_IP) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ECN target: Only use --ecn-ip-ect ONCE!"); if (!xtables_strtoui(optarg, NULL, &result, 0, 3)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ECN target: Value out of range"); einfo->operation |= IPT_ECN_OP_SET_IP; einfo->ip_ect = result; @@ -100,7 +100,7 @@ static int ECN_parse(int c, char **argv, int invert, unsigned int *flags, static void ECN_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ECN target: Parameter --ecn-tcp-remove is required"); } diff --git a/extensions/libipt_LOG.c b/extensions/libipt_LOG.c index bc7e8a4e..4da412c1 100644 --- a/extensions/libipt_LOG.c +++ b/extensions/libipt_LOG.c @@ -79,7 +79,7 @@ parse_level(const char *level) if (strncasecmp(level, ipt_log_names[i].name, strlen(level)) == 0) { if (set++) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "log-level `%s' ambiguous", level); lev = ipt_log_names[i].level; @@ -87,7 +87,7 @@ parse_level(const char *level) } if (!set) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "log-level `%s' unknown", level); } @@ -109,11 +109,11 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '!': if (*flags & IPT_LOG_OPT_LEVEL) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --log-level twice"); if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --log-level"); loginfo->level = parse_level(optarg); @@ -122,24 +122,24 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags, case '#': if (*flags & IPT_LOG_OPT_PREFIX) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --log-prefix twice"); if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --log-prefix"); if (strlen(optarg) > sizeof(loginfo->prefix) - 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Maximum prefix length %u for --log-prefix", (unsigned int)sizeof(loginfo->prefix) - 1); if (strlen(optarg) == 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "No prefix specified for --log-prefix"); if (strlen(optarg) != strlen(strtok(optarg, "\n"))) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Newlines not allowed in --log-prefix"); strcpy(loginfo->prefix, optarg); @@ -148,7 +148,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags, case '1': if (*flags & IPT_LOG_OPT_TCPSEQ) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --log-tcp-sequence " "twice"); @@ -158,7 +158,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags, case '2': if (*flags & IPT_LOG_OPT_TCPOPT) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --log-tcp-options twice"); loginfo->logflags |= IPT_LOG_TCPOPT; @@ -167,7 +167,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags, case '3': if (*flags & IPT_LOG_OPT_IPOPT) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --log-ip-options twice"); loginfo->logflags |= IPT_LOG_IPOPT; @@ -176,7 +176,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags, case '4': if (*flags & IPT_LOG_OPT_UID) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --log-uid twice"); loginfo->logflags |= IPT_LOG_UID; diff --git a/extensions/libipt_MASQUERADE.c b/extensions/libipt_MASQUERADE.c index 0ee155c2..0180bf6b 100644 --- a/extensions/libipt_MASQUERADE.c +++ b/extensions/libipt_MASQUERADE.c @@ -44,7 +44,7 @@ parse_ports(const char *arg, struct ip_nat_multi_range *mr) port = atoi(arg); if (port <= 0 || port > 65535) - exit_error(PARAMETER_PROBLEM, "Port `%s' not valid\n", arg); + xtables_error(PARAMETER_PROBLEM, "Port \"%s\" not valid\n", arg); dash = strchr(arg, '-'); if (!dash) { @@ -56,11 +56,11 @@ parse_ports(const char *arg, struct ip_nat_multi_range *mr) maxport = atoi(dash + 1); if (maxport == 0 || maxport > 65535) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Port `%s' not valid\n", dash+1); if (maxport < port) /* People are stupid. Present reader excepted. */ - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Port range `%s' funky\n", arg); mr->range[0].min.tcp.port = htons(port); mr->range[0].max.tcp.port = htons(maxport); @@ -87,11 +87,11 @@ static int MASQUERADE_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (!portok) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Need TCP, UDP, SCTP or DCCP with port specification"); if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --to-ports"); parse_ports(optarg, mr); diff --git a/extensions/libipt_NETMAP.c b/extensions/libipt_NETMAP.c index 9949c99b..b1d79ce2 100644 --- a/extensions/libipt_NETMAP.c +++ b/extensions/libipt_NETMAP.c @@ -77,26 +77,26 @@ parse_to(char *arg, struct ip_nat_range *range) ip = xtables_numeric_to_ipaddr(arg); if (!ip) - exit_error(PARAMETER_PROBLEM, "Bad IP address `%s'\n", + xtables_error(PARAMETER_PROBLEM, "Bad IP address \"%s\"\n", arg); range->min_ip = ip->s_addr; if (slash) { if (strchr(slash+1, '.')) { ip = xtables_numeric_to_ipmask(slash+1); if (!ip) - exit_error(PARAMETER_PROBLEM, "Bad netmask `%s'\n", + xtables_error(PARAMETER_PROBLEM, "Bad netmask \"%s\"\n", slash+1); netmask = ip->s_addr; } else { if (!xtables_strtoui(slash+1, NULL, &bits, 0, 32)) - exit_error(PARAMETER_PROBLEM, "Bad netmask `%s'\n", + xtables_error(PARAMETER_PROBLEM, "Bad netmask \"%s\"\n", slash+1); netmask = bits2netmask(bits); } /* Don't allow /0 (/1 is probably insane, too) */ if (netmask == 0) - exit_error(PARAMETER_PROBLEM, "Netmask needed\n"); + xtables_error(PARAMETER_PROBLEM, "Netmask needed\n"); } else netmask = ~0; @@ -104,7 +104,7 @@ parse_to(char *arg, struct ip_nat_range *range) if (range->min_ip & ~netmask) { if (slash) *slash = '/'; - exit_error(PARAMETER_PROBLEM, "Bad network address `%s'\n", + xtables_error(PARAMETER_PROBLEM, "Bad network address \"%s\"\n", arg); } range->max_ip = range->min_ip | ~netmask; @@ -119,7 +119,7 @@ static int NETMAP_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --%s", NETMAP_opts[0].name); parse_to(optarg, &mr->range[0]); @@ -134,7 +134,7 @@ static int NETMAP_parse(int c, char **argv, int invert, unsigned int *flags, static void NETMAP_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, MODULENAME" needs --%s", NETMAP_opts[0].name); } diff --git a/extensions/libipt_REDIRECT.c b/extensions/libipt_REDIRECT.c index c6afbdcc..8fcb46a9 100644 --- a/extensions/libipt_REDIRECT.c +++ b/extensions/libipt_REDIRECT.c @@ -44,14 +44,14 @@ parse_ports(const char *arg, struct ip_nat_multi_range *mr) mr->range[0].flags |= IP_NAT_RANGE_PROTO_SPECIFIED; if (strchr(arg, '.')) - exit_error(PARAMETER_PROBLEM, "IP address not permitted\n"); + xtables_error(PARAMETER_PROBLEM, "IP address not permitted\n"); port = atoi(arg); if (port == 0) port = xtables_service_to_port(arg, NULL); if (port == 0 || port > 65535) - exit_error(PARAMETER_PROBLEM, "Port `%s' not valid\n", arg); + xtables_error(PARAMETER_PROBLEM, "Port \"%s\" not valid\n", arg); dash = strchr(arg, '-'); if (!dash) { @@ -63,11 +63,11 @@ parse_ports(const char *arg, struct ip_nat_multi_range *mr) maxport = atoi(dash + 1); if (maxport == 0 || maxport > 65535) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Port `%s' not valid\n", dash+1); if (maxport < port) /* People are stupid. */ - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Port range `%s' funky\n", arg); mr->range[0].min.tcp.port = htons(port); mr->range[0].max.tcp.port = htons(maxport); @@ -94,11 +94,11 @@ static int REDIRECT_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (!portok) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Need TCP, UDP, SCTP or DCCP with port specification"); if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --to-ports"); parse_ports(optarg, mr); diff --git a/extensions/libipt_REJECT.c b/extensions/libipt_REJECT.c index db94306e..98d8dcba 100644 --- a/extensions/libipt_REJECT.c +++ b/extensions/libipt_REJECT.c @@ -100,7 +100,7 @@ static int REJECT_parse(int c, char **argv, int invert, unsigned int *flags, switch(c) { case '1': if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --reject-with"); for (i = 0; i < limit; i++) { if ((strncasecmp(reject_table[i].name, optarg, strlen(optarg)) == 0) @@ -114,7 +114,7 @@ static int REJECT_parse(int c, char **argv, int invert, unsigned int *flags, || strncasecmp("echoreply", optarg, strlen(optarg)) == 0) fprintf(stderr, "--reject-with echo-reply no longer" " supported\n"); - exit_error(PARAMETER_PROBLEM, "unknown reject type `%s'",optarg); + xtables_error(PARAMETER_PROBLEM, "unknown reject type \"%s\"", optarg); default: /* Fall through */ break; diff --git a/extensions/libipt_SAME.c b/extensions/libipt_SAME.c index 007ebc35..444a5208 100644 --- a/extensions/libipt_SAME.c +++ b/extensions/libipt_SAME.c @@ -58,20 +58,20 @@ parse_to(char *arg, struct ip_nat_range *range) ip = xtables_numeric_to_ipaddr(arg); if (!ip) - exit_error(PARAMETER_PROBLEM, "Bad IP address `%s'\n", + xtables_error(PARAMETER_PROBLEM, "Bad IP address \"%s\"\n", arg); range->min_ip = ip->s_addr; if (dash) { ip = xtables_numeric_to_ipaddr(dash+1); if (!ip) - exit_error(PARAMETER_PROBLEM, "Bad IP address `%s'\n", + xtables_error(PARAMETER_PROBLEM, "Bad IP address \"%s\"\n", dash+1); } range->max_ip = ip->s_addr; if (dash) if (range->min_ip > range->max_ip) - exit_error(PARAMETER_PROBLEM, "Bad IP range `%s-%s'\n", + xtables_error(PARAMETER_PROBLEM, "Bad IP range \"%s-%s\"\n", arg, dash+1); } @@ -89,12 +89,12 @@ static int SAME_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (mr->rangesize == IPT_SAME_MAX_RANGE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Too many ranges specified, maximum " "is %i ranges.\n", IPT_SAME_MAX_RANGE); if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --to"); parse_to(optarg, &mr->range[mr->rangesize]); @@ -108,7 +108,7 @@ static int SAME_parse(int c, char **argv, int invert, unsigned int *flags, case '2': if (*flags & IPT_SAME_OPT_NODST) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --nodst twice"); mr->info |= IPT_SAME_NODST; @@ -131,7 +131,7 @@ static int SAME_parse(int c, char **argv, int invert, unsigned int *flags, static void SAME_check(unsigned int flags) { if (!(flags & IPT_SAME_OPT_TO)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "SAME needs --to"); } diff --git a/extensions/libipt_SET.c b/extensions/libipt_SET.c index 45967be2..e9bdab48 100644 --- a/extensions/libipt_SET.c +++ b/extensions/libipt_SET.c @@ -54,20 +54,20 @@ parse_target(char **argv, int invert, unsigned int *flags, struct ipt_set_info *info, const char *what) { if (info->flags[0]) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--%s can be specified only once", what); if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --%s", what); if (!argv[optind] || argv[optind][0] == '-' || argv[optind][0] == '!') - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--%s requires two args.", what); if (strlen(argv[optind-1]) > IP_SET_MAXNAMELEN - 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "setname `%s' too long, max %d characters.", argv[optind-1], IP_SET_MAXNAMELEN - 1); @@ -103,7 +103,7 @@ static int SET_parse(int c, char **argv, int invert, unsigned int *flags, static void SET_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "You must specify either `--add-set' or `--del-set'"); } diff --git a/extensions/libipt_SNAT.c b/extensions/libipt_SNAT.c index 96ef56e4..fda03ea4 100644 --- a/extensions/libipt_SNAT.c +++ b/extensions/libipt_SNAT.c @@ -45,7 +45,7 @@ append_range(struct ipt_natinfo *info, const struct ip_nat_range *range) info = realloc(info, size); if (!info) - exit_error(OTHER_PROBLEM, "Out of memory\n"); + xtables_error(OTHER_PROBLEM, "Out of memory\n"); info->t.u.target_size = size; info->mr.range[info->mr.rangesize] = *range; @@ -69,19 +69,19 @@ parse_to(char *arg, int portok, struct ipt_natinfo *info) int port; if (!portok) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Need TCP, UDP, SCTP or DCCP with port specification"); range.flags |= IP_NAT_RANGE_PROTO_SPECIFIED; port = atoi(colon+1); if (port <= 0 || port > 65535) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Port `%s' not valid\n", colon+1); error = strchr(colon+1, ':'); if (error) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid port:port syntax - use dash\n"); dash = strchr(colon, '-'); @@ -94,11 +94,11 @@ parse_to(char *arg, int portok, struct ipt_natinfo *info) maxport = atoi(dash + 1); if (maxport <= 0 || maxport > 65535) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Port `%s' not valid\n", dash+1); if (maxport < port) /* People are stupid. */ - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Port range `%s' funky\n", colon+1); range.min.tcp.port = htons(port); range.max.tcp.port = htons(maxport); @@ -119,13 +119,13 @@ parse_to(char *arg, int portok, struct ipt_natinfo *info) ip = xtables_numeric_to_ipaddr(arg); if (!ip) - exit_error(PARAMETER_PROBLEM, "Bad IP address `%s'\n", + xtables_error(PARAMETER_PROBLEM, "Bad IP address \"%s\"\n", arg); range.min_ip = ip->s_addr; if (dash) { ip = xtables_numeric_to_ipaddr(dash+1); if (!ip) - exit_error(PARAMETER_PROBLEM, "Bad IP address `%s'\n", + xtables_error(PARAMETER_PROBLEM, "Bad IP address \"%s\"\n", dash+1); range.max_ip = ip->s_addr; } else @@ -153,14 +153,14 @@ static int SNAT_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --to-source"); if (*flags & IPT_SNAT_OPT_SOURCE) { if (!kernel_version) get_kernel_version(); if (kernel_version > LINUX_VERSION(2, 6, 10)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Multiple --to-source not supported"); } *target = parse_to(optarg, portok, info); @@ -186,7 +186,7 @@ static int SNAT_parse(int c, char **argv, int invert, unsigned int *flags, static void SNAT_check(unsigned int flags) { if (!(flags & IPT_SNAT_OPT_SOURCE)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "You must specify --to-source"); } diff --git a/extensions/libipt_TTL.c b/extensions/libipt_TTL.c index 15d23ba2..25018777 100644 --- a/extensions/libipt_TTL.c +++ b/extensions/libipt_TTL.c @@ -32,20 +32,20 @@ static int TTL_parse(int c, char **argv, int invert, unsigned int *flags, unsigned int value; if (*flags & IPT_TTL_USED) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify TTL option twice"); } if (!optarg) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "TTL: You must specify a value"); if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "TTL: unexpected `!'"); if (!xtables_strtoui(optarg, NULL, &value, 0, UINT8_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "TTL: Expected value between 0 and 255"); switch (c) { @@ -56,7 +56,7 @@ static int TTL_parse(int c, char **argv, int invert, unsigned int *flags, case '2': if (value == 0) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "TTL: decreasing by 0?"); } @@ -65,7 +65,7 @@ static int TTL_parse(int c, char **argv, int invert, unsigned int *flags, case '3': if (value == 0) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "TTL: increasing by 0?"); } @@ -86,7 +86,7 @@ static int TTL_parse(int c, char **argv, int invert, unsigned int *flags, static void TTL_check(unsigned int flags) { if (!(flags & IPT_TTL_USED)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "TTL: You must specify an action"); } diff --git a/extensions/libipt_ULOG.c b/extensions/libipt_ULOG.c index 89d09409..9633a87b 100644 --- a/extensions/libipt_ULOG.c +++ b/extensions/libipt_ULOG.c @@ -74,15 +74,15 @@ static int ULOG_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '!': if (*flags & IPT_LOG_OPT_NLGROUP) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --ulog-nlgroup twice"); if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --ulog-nlgroup"); group_d = atoi(optarg); if (group_d > 32 || group_d < 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--ulog-nlgroup has to be between 1 and 32"); loginfo->nl_group = (1 << (group_d - 1)); @@ -92,24 +92,24 @@ static int ULOG_parse(int c, char **argv, int invert, unsigned int *flags, case '#': if (*flags & IPT_LOG_OPT_PREFIX) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --ulog-prefix twice"); if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --ulog-prefix"); if (strlen(optarg) > sizeof(loginfo->prefix) - 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Maximum prefix length %u for --ulog-prefix", (unsigned int)sizeof(loginfo->prefix) - 1); if (strlen(optarg) == 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "No prefix specified for --ulog-prefix"); if (strlen(optarg) != strlen(strtok(optarg, "\n"))) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Newlines not allowed in --ulog-prefix"); strcpy(loginfo->prefix, optarg); @@ -117,23 +117,23 @@ static int ULOG_parse(int c, char **argv, int invert, unsigned int *flags, break; case 'A': if (*flags & IPT_LOG_OPT_CPRANGE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --ulog-cprange twice"); if (atoi(optarg) < 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Negative copy range?"); loginfo->copy_range = atoi(optarg); *flags |= IPT_LOG_OPT_CPRANGE; break; case 'B': if (*flags & IPT_LOG_OPT_QTHRESHOLD) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --ulog-qthreshold twice"); if (atoi(optarg) < 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Negative or zero queue threshold ?"); if (atoi(optarg) > ULOG_MAX_QLEN) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Maximum queue length exceeded"); loginfo->qthreshold = atoi(optarg); *flags |= IPT_LOG_OPT_QTHRESHOLD; diff --git a/extensions/libipt_addrtype.c b/extensions/libipt_addrtype.c index 446cf0f3..22b35d48 100644 --- a/extensions/libipt_addrtype.c +++ b/extensions/libipt_addrtype.c @@ -81,13 +81,13 @@ static void parse_types(const char *arg, u_int16_t *mask) while ((comma = strchr(arg, ',')) != NULL) { if (comma == arg || !parse_type(arg, comma-arg, mask)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "addrtype: bad type `%s'", arg); arg = comma + 1; } if (strlen(arg) == 0 || !parse_type(arg, strlen(arg), mask)) - exit_error(PARAMETER_PROBLEM, "addrtype: bad type `%s'", arg); + xtables_error(PARAMETER_PROBLEM, "addrtype: bad type \"%s\"", arg); } #define IPT_ADDRTYPE_OPT_SRCTYPE 0x1 @@ -105,7 +105,7 @@ addrtype_parse_v0(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags&IPT_ADDRTYPE_OPT_SRCTYPE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "addrtype: can't specify src-type twice"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_types(argv[optind-1], &info->source); @@ -115,7 +115,7 @@ addrtype_parse_v0(int c, char **argv, int invert, unsigned int *flags, break; case '2': if (*flags&IPT_ADDRTYPE_OPT_DSTTYPE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "addrtype: can't specify dst-type twice"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_types(argv[optind-1], &info->dest); @@ -140,7 +140,7 @@ addrtype_parse_v1(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags & IPT_ADDRTYPE_OPT_SRCTYPE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "addrtype: can't specify src-type twice"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_types(argv[optind-1], &info->source); @@ -150,7 +150,7 @@ addrtype_parse_v1(int c, char **argv, int invert, unsigned int *flags, break; case '2': if (*flags & IPT_ADDRTYPE_OPT_DSTTYPE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "addrtype: can't specify dst-type twice"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_types(argv[optind-1], &info->dest); @@ -160,14 +160,14 @@ addrtype_parse_v1(int c, char **argv, int invert, unsigned int *flags, break; case '3': if (*flags & IPT_ADDRTYPE_OPT_LIMIT_IFACE_IN) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "addrtype: can't specify limit-iface-in twice"); info->flags |= IPT_ADDRTYPE_LIMIT_IFACE_IN; *flags |= IPT_ADDRTYPE_OPT_LIMIT_IFACE_IN; break; case '4': if (*flags & IPT_ADDRTYPE_OPT_LIMIT_IFACE_OUT) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "addrtype: can't specify limit-iface-out twice"); info->flags |= IPT_ADDRTYPE_LIMIT_IFACE_OUT; *flags |= IPT_ADDRTYPE_OPT_LIMIT_IFACE_OUT; @@ -182,18 +182,18 @@ addrtype_parse_v1(int c, char **argv, int invert, unsigned int *flags, static void addrtype_check_v0(unsigned int flags) { if (!(flags & (IPT_ADDRTYPE_OPT_SRCTYPE|IPT_ADDRTYPE_OPT_DSTTYPE))) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "addrtype: you must specify --src-type or --dst-type"); } static void addrtype_check_v1(unsigned int flags) { if (!(flags & (IPT_ADDRTYPE_OPT_SRCTYPE|IPT_ADDRTYPE_OPT_DSTTYPE))) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "addrtype: you must specify --src-type or --dst-type"); if (flags & IPT_ADDRTYPE_OPT_LIMIT_IFACE_IN && flags & IPT_ADDRTYPE_OPT_LIMIT_IFACE_OUT) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "addrtype: you can't specify both --limit-iface-in " "and --limit-iface-out"); } diff --git a/extensions/libipt_ah.c b/extensions/libipt_ah.c index 31977dd6..d049b423 100644 --- a/extensions/libipt_ah.c +++ b/extensions/libipt_ah.c @@ -30,15 +30,15 @@ parse_ah_spi(const char *spistr) spi = strtoul(spistr,&ep,0) ; if ( spistr == ep ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "AH no valid digits in spi `%s'", spistr); } if ( spi == ULONG_MAX && errno == ERANGE ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "spi `%s' specified too big: would overflow", spistr); } if ( *spistr != '\0' && *ep != '\0' ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "AH error parsing spi `%s'", spistr); } return spi; @@ -80,7 +80,7 @@ static int ah_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags & AH_SPI) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--ahspi' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_ah_spis(argv[optind-1], ahinfo->spis); diff --git a/extensions/libipt_ecn.c b/extensions/libipt_ecn.c index 3b9da71a..0f8849df 100644 --- a/extensions/libipt_ecn.c +++ b/extensions/libipt_ecn.c @@ -42,7 +42,7 @@ static int ecn_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case 'F': if (*flags & IPT_ECN_OP_MATCH_CWR) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ECN match: can only use parameter ONCE!"); xtables_check_inverse(optarg, &invert, &optind, 0); einfo->operation |= IPT_ECN_OP_MATCH_CWR; @@ -53,7 +53,7 @@ static int ecn_parse(int c, char **argv, int invert, unsigned int *flags, case 'G': if (*flags & IPT_ECN_OP_MATCH_ECE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ECN match: can only use parameter ONCE!"); xtables_check_inverse(optarg, &invert, &optind, 0); einfo->operation |= IPT_ECN_OP_MATCH_ECE; @@ -64,7 +64,7 @@ static int ecn_parse(int c, char **argv, int invert, unsigned int *flags, case 'H': if (*flags & IPT_ECN_OP_MATCH_IP) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ECN match: can only use parameter ONCE!"); xtables_check_inverse(optarg, &invert, &optind, 0); if (invert) @@ -72,7 +72,7 @@ static int ecn_parse(int c, char **argv, int invert, unsigned int *flags, *flags |= IPT_ECN_OP_MATCH_IP; einfo->operation |= IPT_ECN_OP_MATCH_IP; if (!xtables_strtoui(optarg, NULL, &result, 0, 3)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ECN match: Value out of range"); einfo->ip_ect = result; break; @@ -86,7 +86,7 @@ static int ecn_parse(int c, char **argv, int invert, unsigned int *flags, static void ecn_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ECN match: some option required"); } diff --git a/extensions/libipt_icmp.c b/extensions/libipt_icmp.c index 0fd132be..7dac0b72 100644 --- a/extensions/libipt_icmp.c +++ b/extensions/libipt_icmp.c @@ -122,7 +122,7 @@ parse_icmp(const char *icmptype, u_int8_t *type, u_int8_t code[]) if (strncasecmp(icmp_codes[i].name, icmptype, strlen(icmptype)) == 0) { if (match != limit) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Ambiguous ICMP type `%s':" " `%s' or `%s'?", icmptype, @@ -148,12 +148,12 @@ parse_icmp(const char *icmptype, u_int8_t *type, u_int8_t code[]) *slash = '\0'; if (!xtables_strtoui(buffer, NULL, &number, 0, UINT8_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid ICMP type `%s'\n", buffer); *type = number; if (slash) { if (!xtables_strtoui(slash+1, NULL, &number, 0, UINT8_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid ICMP code `%s'\n", slash+1); code[0] = code[1] = number; @@ -180,7 +180,7 @@ static int icmp_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags == 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "icmp match: only use --icmp-type once!"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_icmp(argv[optind-1], &icmpinfo->type, diff --git a/extensions/libipt_policy.c b/extensions/libipt_policy.c index a538927f..964c19a4 100644 --- a/extensions/libipt_policy.c +++ b/extensions/libipt_policy.c @@ -98,7 +98,7 @@ static int parse_direction(char *s) return IPT_POLICY_MATCH_IN; if (strcmp(s, "out") == 0) return IPT_POLICY_MATCH_OUT; - exit_error(PARAMETER_PROBLEM, "policy_match: invalid dir `%s'", s); + xtables_error(PARAMETER_PROBLEM, "policy_match: invalid dir \"%s\"", s); } static int parse_policy(char *s) @@ -107,7 +107,7 @@ static int parse_policy(char *s) return IPT_POLICY_MATCH_NONE; if (strcmp(s, "ipsec") == 0) return 0; - exit_error(PARAMETER_PROBLEM, "policy match: invalid policy `%s'", s); + xtables_error(PARAMETER_PROBLEM, "policy match: invalid policy \"%s\"", s); } static int parse_mode(char *s) @@ -116,7 +116,7 @@ static int parse_mode(char *s) return IPT_POLICY_MODE_TRANSPORT; if (strcmp(s, "tunnel") == 0) return IPT_POLICY_MODE_TUNNEL; - exit_error(PARAMETER_PROBLEM, "policy match: invalid mode `%s'", s); + xtables_error(PARAMETER_PROBLEM, "policy match: invalid mode \"%s\"", s); } static int policy_parse(int c, char **argv, int invert, unsigned int *flags, @@ -133,35 +133,35 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (info->flags & (IPT_POLICY_MATCH_IN|IPT_POLICY_MATCH_OUT)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: double --dir option"); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: can't invert --dir option"); info->flags |= parse_direction(argv[optind-1]); break; case '2': if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: can't invert --policy option"); info->flags |= parse_policy(argv[optind-1]); break; case '3': if (info->flags & IPT_POLICY_MATCH_STRICT) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: double --strict option"); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: can't invert --strict option"); info->flags |= IPT_POLICY_MATCH_STRICT; break; case '4': if (e->match.reqid) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: double --reqid option"); e->match.reqid = 1; @@ -170,7 +170,7 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags, break; case '5': if (e->match.spi) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: double --spi option"); e->match.spi = 1; @@ -179,12 +179,12 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags, break; case '6': if (e->match.saddr) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: double --tunnel-src option"); xtables_ipparse_any(argv[optind-1], &addr, &mask, &naddr); if (naddr > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: name resolves to multiple IPs"); e->match.saddr = 1; @@ -194,12 +194,12 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags, break; case '7': if (e->match.daddr) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: double --tunnel-dst option"); xtables_ipparse_any(argv[optind-1], &addr, &mask, &naddr); if (naddr > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: name resolves to multiple IPs"); e->match.daddr = 1; @@ -209,20 +209,20 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags, break; case '8': if (e->match.proto) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: double --proto option"); e->proto = xtables_parse_protocol(argv[optind-1]); if (e->proto != IPPROTO_AH && e->proto != IPPROTO_ESP && e->proto != IPPROTO_COMP) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: protocol must ah/esp/ipcomp"); e->match.proto = 1; e->invert.proto = invert; break; case '9': if (e->match.mode) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: double --mode option"); mode = parse_mode(argv[optind-1]); @@ -232,11 +232,11 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags, break; case 'a': if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: can't invert --next option"); if (++info->len == IPT_POLICY_MAX_ELEM) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: maximum policy depth reached"); break; default: @@ -254,26 +254,26 @@ static void policy_check(unsigned int flags) int i; if (info == NULL) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: no parameters given"); if (!(info->flags & (IPT_POLICY_MATCH_IN|IPT_POLICY_MATCH_OUT))) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: neither --in nor --out specified"); if (info->flags & IPT_POLICY_MATCH_NONE) { if (info->flags & IPT_POLICY_MATCH_STRICT) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: policy none but --strict given"); if (info->len != 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: policy none but policy given"); } else info->len++; /* increase len by 1, no --next after last element */ if (!(info->flags & IPT_POLICY_MATCH_STRICT) && info->len > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: multiple elements but no --strict"); for (i = 0; i < info->len; i++) { @@ -282,13 +282,13 @@ static void policy_check(unsigned int flags) if (info->flags & IPT_POLICY_MATCH_STRICT && !(e->match.reqid || e->match.spi || e->match.saddr || e->match.daddr || e->match.proto || e->match.mode)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: empty policy element"); if ((e->match.saddr || e->match.daddr) && ((e->mode == IPT_POLICY_MODE_TUNNEL && e->invert.mode) || (e->mode == IPT_POLICY_MODE_TRANSPORT && !e->invert.mode))) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "policy match: --tunnel-src/--tunnel-dst " "is only valid in tunnel mode"); } diff --git a/extensions/libipt_realm.c b/extensions/libipt_realm.c index e602dad1..3dd63d3e 100644 --- a/extensions/libipt_realm.c +++ b/extensions/libipt_realm.c @@ -166,12 +166,12 @@ static int realm_parse(int c, char **argv, int invert, unsigned int *flags, else realminfo->mask = 0xffffffff; if (*end != '\0' || end == optarg) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Bad realm value `%s'", optarg); } else { id = realm_name2id(optarg); if (id == -1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Realm `%s' not found", optarg); realminfo->id = id; realminfo->mask = 0xffffffff; @@ -230,7 +230,7 @@ static void realm_save(const void *ip, const struct xt_entry_match *match) static void realm_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "realm match: You must specify `--realm'"); } diff --git a/extensions/libipt_set.c b/extensions/libipt_set.c index 5b9e1fdc..845b2b0e 100644 --- a/extensions/libipt_set.c +++ b/extensions/libipt_set.c @@ -55,7 +55,7 @@ static int set_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': /* --set [, */ if (info->flags[0]) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--set can be specified only once"); xtables_check_inverse(optarg, &invert, &optind, 0); @@ -65,11 +65,11 @@ static int set_parse(int c, char **argv, int invert, unsigned int *flags, if (!argv[optind] || argv[optind][0] == '-' || argv[optind][0] == '!') - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--set requires two args."); if (strlen(argv[optind-1]) > IP_SET_MAXNAMELEN - 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "setname `%s' too long, max %d characters.", argv[optind-1], IP_SET_MAXNAMELEN - 1); @@ -91,7 +91,7 @@ static int set_parse(int c, char **argv, int invert, unsigned int *flags, static void set_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "You must specify `--set' with proper arguments"); DEBUGP("final check OK\n"); } diff --git a/extensions/libipt_set.h b/extensions/libipt_set.h index 3e70d7be..f521e05f 100644 --- a/extensions/libipt_set.h +++ b/extensions/libipt_set.h @@ -25,12 +25,12 @@ parse_bindings(const char *opt_arg, struct ipt_set_info *info) else if (strncmp(ptr, "dst", 3) == 0) info->flags[i++] |= IPSET_DST; else - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "You must spefify (the comma separated list of) 'src' or 'dst'."); } if (tmp) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't follow bindings deeper than %i.", IP_SET_MAX_BINDINGS - 1); @@ -42,7 +42,7 @@ static int get_set_getsockopt(void *data, socklen_t * size) int sockfd = -1; sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); if (sockfd < 0) - exit_error(OTHER_PROBLEM, + xtables_error(OTHER_PROBLEM, "Can't open socket to ipset.\n"); /* Send! */ return getsockopt(sockfd, SOL_IP, SO_IP_SET, data, size); @@ -60,16 +60,16 @@ static void get_set_byname(const char *setname, struct ipt_set_info *info) req.set.name[IP_SET_MAXNAMELEN - 1] = '\0'; res = get_set_getsockopt(&req, &size); if (res != 0) - exit_error(OTHER_PROBLEM, + xtables_error(OTHER_PROBLEM, "Problem when communicating with ipset, errno=%d.\n", errno); if (size != sizeof(struct ip_set_req_get_set)) - exit_error(OTHER_PROBLEM, + xtables_error(OTHER_PROBLEM, "Incorrect return size from kernel during ipset lookup, " "(want %zu, got %zu)\n", sizeof(struct ip_set_req_get_set), (size_t)size); if (req.set.index == IP_SET_INVALID_ID) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Set %s doesn't exist.\n", setname); info->index = req.set.index; @@ -86,16 +86,16 @@ static void get_set_byid(char * setname, ip_set_id_t idx) req.set.index = idx; res = get_set_getsockopt(&req, &size); if (res != 0) - exit_error(OTHER_PROBLEM, + xtables_error(OTHER_PROBLEM, "Problem when communicating with ipset, errno=%d.\n", errno); if (size != sizeof(struct ip_set_req_get_set)) - exit_error(OTHER_PROBLEM, + xtables_error(OTHER_PROBLEM, "Incorrect return size from kernel during ipset lookup, " "(want %zu, got %zu)\n", sizeof(struct ip_set_req_get_set), (size_t)size); if (req.set.name[0] == '\0') - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Set id %i in kernel doesn't exist.\n", idx); strncpy(setname, req.set.name, IP_SET_MAXNAMELEN); diff --git a/extensions/libipt_ttl.c b/extensions/libipt_ttl.c index 3387e924..67f0b1ad 100644 --- a/extensions/libipt_ttl.c +++ b/extensions/libipt_ttl.c @@ -34,7 +34,7 @@ static int ttl_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '2': if (!xtables_strtoui(optarg, NULL, &value, 0, UINT8_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ttl: Expected value between 0 and 255"); if (invert) @@ -47,11 +47,11 @@ static int ttl_parse(int c, char **argv, int invert, unsigned int *flags, break; case '3': if (!xtables_strtoui(optarg, NULL, &value, 0, UINT8_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ttl: Expected value between 0 and 255"); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ttl: unexpected `!'"); info->mode = IPT_TTL_LT; @@ -59,11 +59,11 @@ static int ttl_parse(int c, char **argv, int invert, unsigned int *flags, break; case '4': if (!xtables_strtoui(optarg, NULL, &value, 0, UINT8_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ttl: Expected value between 0 and 255"); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ttl: unexpected `!'"); info->mode = IPT_TTL_GT; @@ -75,7 +75,7 @@ static int ttl_parse(int c, char **argv, int invert, unsigned int *flags, } if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify TTL option twice"); *flags = 1; @@ -85,7 +85,7 @@ static int ttl_parse(int c, char **argv, int invert, unsigned int *flags, static void ttl_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "TTL match: You must specify one of " "`--ttl-eq', `--ttl-lt', `--ttl-gt"); } diff --git a/extensions/libxt_CLASSIFY.c b/extensions/libxt_CLASSIFY.c index 113f6807..119922d0 100644 --- a/extensions/libxt_CLASSIFY.c +++ b/extensions/libxt_CLASSIFY.c @@ -45,10 +45,10 @@ CLASSIFY_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (CLASSIFY_string_to_priority(optarg, &clinfo->priority)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Bad class value `%s'", optarg); if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "CLASSIFY: Can't specify --set-class twice"); *flags = 1; break; @@ -64,7 +64,7 @@ static void CLASSIFY_final_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "CLASSIFY: Parameter --set-class is required"); } diff --git a/extensions/libxt_CONNMARK.c b/extensions/libxt_CONNMARK.c index e426e4f1..6e42898f 100644 --- a/extensions/libxt_CONNMARK.c +++ b/extensions/libxt_CONNMARK.c @@ -111,34 +111,34 @@ CONNMARK_parse(int c, char **argv, int invert, unsigned int *flags, markinfo->mask = strtoul(end+1, &end, 0); if (*end != '\0' || end == optarg) - exit_error(PARAMETER_PROBLEM, "Bad MARK value `%s'", optarg); + xtables_error(PARAMETER_PROBLEM, "Bad MARK value \"%s\"", optarg); if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "CONNMARK target: Can't specify --set-mark twice"); *flags = 1; break; case '2': markinfo->mode = XT_CONNMARK_SAVE; if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "CONNMARK target: Can't specify --save-mark twice"); *flags = 1; break; case '3': markinfo->mode = XT_CONNMARK_RESTORE; if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "CONNMARK target: Can't specify --restore-mark twice"); *flags = 1; break; case '4': if (!*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "CONNMARK target: Can't specify --mask without a operation"); markinfo->mask = strtoul(optarg, &end, 0); if (*end != '\0' || end == optarg) - exit_error(PARAMETER_PROBLEM, "Bad MASK value `%s'", optarg); + xtables_error(PARAMETER_PROBLEM, "Bad MASK value \"%s\"", optarg); break; default: return 0; @@ -218,7 +218,7 @@ static int connmark_tg_parse(int c, char **argv, int invert, case 'n': /* --nfmask */ if (!(*flags & F_SR_MARK)) - exit_error(PARAMETER_PROBLEM, "CONNMARK: --save-mark " + xtables_error(PARAMETER_PROBLEM, "CONNMARK: --save-mark " "or --restore-mark is required for " "--nfmask"); if (!xtables_strtoui(optarg, NULL, &value, 0, UINT32_MAX)) @@ -228,7 +228,7 @@ static int connmark_tg_parse(int c, char **argv, int invert, case 'c': /* --ctmask */ if (!(*flags & F_SR_MARK)) - exit_error(PARAMETER_PROBLEM, "CONNMARK: --save-mark " + xtables_error(PARAMETER_PROBLEM, "CONNMARK: --save-mark " "or --restore-mark is required for " "--ctmask"); if (!xtables_strtoui(optarg, NULL, &value, 0, UINT32_MAX)) @@ -238,7 +238,7 @@ static int connmark_tg_parse(int c, char **argv, int invert, case 'm': /* --mask */ if (!(*flags & F_SR_MARK)) - exit_error(PARAMETER_PROBLEM, "CONNMARK: --save-mark " + xtables_error(PARAMETER_PROBLEM, "CONNMARK: --save-mark " "or --restore-mark is required for " "--mask"); if (!xtables_strtoui(optarg, NULL, &value, 0, UINT32_MAX)) @@ -253,7 +253,7 @@ static int connmark_tg_parse(int c, char **argv, int invert, static void connmark_tg_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "CONNMARK target: No operation specified"); } diff --git a/extensions/libxt_CONNSECMARK.c b/extensions/libxt_CONNSECMARK.c index 05dbf70d..1515f6f0 100644 --- a/extensions/libxt_CONNSECMARK.c +++ b/extensions/libxt_CONNSECMARK.c @@ -38,7 +38,7 @@ CONNSECMARK_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags & CONNSECMARK_SAVE) - exit_error(PARAMETER_PROBLEM, PFX + xtables_error(PARAMETER_PROBLEM, PFX "Can't specify --save twice"); info->mode = CONNSECMARK_SAVE; *flags |= CONNSECMARK_SAVE; @@ -46,7 +46,7 @@ CONNSECMARK_parse(int c, char **argv, int invert, unsigned int *flags, case '2': if (*flags & CONNSECMARK_RESTORE) - exit_error(PARAMETER_PROBLEM, PFX + xtables_error(PARAMETER_PROBLEM, PFX "Can't specify --restore twice"); info->mode = CONNSECMARK_RESTORE; *flags |= CONNSECMARK_RESTORE; @@ -62,10 +62,10 @@ CONNSECMARK_parse(int c, char **argv, int invert, unsigned int *flags, static void CONNSECMARK_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, PFX "parameter required"); + xtables_error(PARAMETER_PROBLEM, PFX "parameter required"); if (flags == (CONNSECMARK_SAVE|CONNSECMARK_RESTORE)) - exit_error(PARAMETER_PROBLEM, PFX "only one flag of --save " + xtables_error(PARAMETER_PROBLEM, PFX "only one flag of --save " "or --restore is allowed"); } @@ -81,7 +81,7 @@ static void print_connsecmark(struct xt_connsecmark_target_info *info) break; default: - exit_error(OTHER_PROBLEM, PFX "invalid mode %hhu\n", info->mode); + xtables_error(OTHER_PROBLEM, PFX "invalid mode %hhu\n", info->mode); } } diff --git a/extensions/libxt_DSCP.c b/extensions/libxt_DSCP.c index aac8f9b0..ddb9c997 100644 --- a/extensions/libxt_DSCP.c +++ b/extensions/libxt_DSCP.c @@ -49,11 +49,11 @@ parse_dscp(const char *s, struct xt_DSCP_info *dinfo) unsigned int dscp; if (!xtables_strtoui(s, NULL, &dscp, 0, UINT8_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid dscp `%s'\n", s); if (dscp > XT_DSCP_MAX) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "DSCP `%d` out of range\n", dscp); dinfo->dscp = dscp; @@ -79,14 +79,14 @@ static int DSCP_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case 'F': if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "DSCP target: Only use --set-dscp ONCE!"); parse_dscp(optarg, dinfo); *flags = 1; break; case 'G': if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "DSCP target: Only use --set-dscp-class ONCE!"); parse_class(optarg, dinfo); *flags = 1; @@ -102,7 +102,7 @@ static int DSCP_parse(int c, char **argv, int invert, unsigned int *flags, static void DSCP_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "DSCP target: Parameter --set-dscp is required"); } diff --git a/extensions/libxt_MARK.c b/extensions/libxt_MARK.c index 8f04e8e7..ec2fe96a 100644 --- a/extensions/libxt_MARK.c +++ b/extensions/libxt_MARK.c @@ -63,18 +63,18 @@ MARK_parse_v0(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (!xtables_strtoui(optarg, NULL, &mark, 0, UINT32_MAX)) - exit_error(PARAMETER_PROBLEM, "Bad MARK value `%s'", optarg); + xtables_error(PARAMETER_PROBLEM, "Bad MARK value \"%s\"", optarg); markinfo->mark = mark; if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "MARK target: Can't specify --set-mark twice"); *flags = 1; break; case '2': - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "MARK target: kernel too old for --and-mark"); case '3': - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "MARK target: kernel too old for --or-mark"); default: return 0; @@ -86,7 +86,7 @@ MARK_parse_v0(int c, char **argv, int invert, unsigned int *flags, static void MARK_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "MARK target: Parameter --set/and/or-mark" " is required"); } @@ -114,10 +114,10 @@ MARK_parse_v1(int c, char **argv, int invert, unsigned int *flags, } if (!xtables_strtoui(optarg, NULL, &mark, 0, UINT32_MAX)) - exit_error(PARAMETER_PROBLEM, "Bad MARK value `%s'", optarg); + xtables_error(PARAMETER_PROBLEM, "Bad MARK value \"%s\"", optarg); markinfo->mark = mark; if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "MARK target: Can't specify --set-mark twice"); *flags = 1; @@ -188,7 +188,7 @@ static int mark_tg_parse(int c, char **argv, int invert, unsigned int *flags, static void mark_tg_check(unsigned int flags) { if (flags == 0) - exit_error(PARAMETER_PROBLEM, "MARK: One of the --set-xmark, " + xtables_error(PARAMETER_PROBLEM, "MARK: One of the --set-xmark, " "--{and,or,xor,set}-mark options is required"); } diff --git a/extensions/libxt_NFLOG.c b/extensions/libxt_NFLOG.c index 6d8c9dc6..007c7b4e 100644 --- a/extensions/libxt_NFLOG.c +++ b/extensions/libxt_NFLOG.c @@ -49,56 +49,56 @@ static int NFLOG_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case NFLOG_GROUP: if (*flags & NFLOG_GROUP) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --nflog-group twice"); if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --nflog-group"); n = atoi(optarg); if (n < 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--nflog-group can not be negative"); info->group = n; break; case NFLOG_PREFIX: if (*flags & NFLOG_PREFIX) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --nflog-prefix twice"); if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --nflog-prefix"); length = strlen(optarg); if (length == 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "No prefix specified for --nflog-prefix"); if (length >= sizeof(info->prefix)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--nflog-prefix too long, max %Zu characters", sizeof(info->prefix) - 1); if (length != strlen(strtok(optarg, "\n"))) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Newlines are not allowed in --nflog-prefix"); strcpy(info->prefix, optarg); break; case NFLOG_RANGE: if (*flags & NFLOG_RANGE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --nflog-range twice"); n = atoi(optarg); if (n < 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid --nflog-range, must be >= 0"); info->len = n; break; case NFLOG_THRESHOLD: if (*flags & NFLOG_THRESHOLD) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify --nflog-threshold twice"); n = atoi(optarg); if (n < 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid --nflog-threshold, must be >= 1"); info->threshold = n; break; diff --git a/extensions/libxt_NFQUEUE.c b/extensions/libxt_NFQUEUE.c index 1c0c23d8..3ca2239f 100644 --- a/extensions/libxt_NFQUEUE.c +++ b/extensions/libxt_NFQUEUE.c @@ -34,7 +34,7 @@ parse_num(const char *s, struct xt_NFQ_info *tinfo) unsigned int num; if (!xtables_strtoui(s, NULL, &num, 0, UINT16_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid queue number `%s'\n", s); tinfo->queuenum = num & 0xffff; @@ -50,7 +50,7 @@ NFQUEUE_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case 'F': if (*flags) - exit_error(PARAMETER_PROBLEM, "NFQUEUE target: " + xtables_error(PARAMETER_PROBLEM, "NFQUEUE target: " "Only use --queue-num ONCE!"); parse_num(optarg, tinfo); break; diff --git a/extensions/libxt_RATEEST.c b/extensions/libxt_RATEEST.c index cf1284f0..d4fd6dd0 100644 --- a/extensions/libxt_RATEEST.c +++ b/extensions/libxt_RATEEST.c @@ -99,7 +99,7 @@ RATEEST_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case RATEEST_OPT_NAME: if (*flags & (1 << c)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "RATEEST: can't specify --rateest-name twice"); *flags |= 1 << c; @@ -108,24 +108,24 @@ RATEEST_parse(int c, char **argv, int invert, unsigned int *flags, case RATEEST_OPT_INTERVAL: if (*flags & (1 << c)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "RATEEST: can't specify --rateest-interval twice"); *flags |= 1 << c; if (RATEEST_get_time(&interval, optarg) < 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "RATEEST: bad interval value `%s'", optarg); break; case RATEEST_OPT_EWMALOG: if (*flags & (1 << c)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "RATEEST: can't specify --rateest-ewmalog twice"); *flags |= 1 << c; if (RATEEST_get_time(&ewma_log, optarg) < 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "RATEEST: bad ewmalog value `%s'", optarg); break; @@ -143,11 +143,11 @@ RATEEST_final_check(unsigned int flags) struct xt_rateest_target_info *info = RATEEST_info; if (!(flags & (1 << RATEEST_OPT_NAME))) - exit_error(PARAMETER_PROBLEM, "RATEEST: no name specified"); + xtables_error(PARAMETER_PROBLEM, "RATEEST: no name specified"); if (!(flags & (1 << RATEEST_OPT_INTERVAL))) - exit_error(PARAMETER_PROBLEM, "RATEEST: no interval specified"); + xtables_error(PARAMETER_PROBLEM, "RATEEST: no interval specified"); if (!(flags & (1 << RATEEST_OPT_EWMALOG))) - exit_error(PARAMETER_PROBLEM, "RATEEST: no ewmalog specified"); + xtables_error(PARAMETER_PROBLEM, "RATEEST: no ewmalog specified"); for (info->interval = 0; info->interval <= 5; info->interval++) { if (interval <= (1 << info->interval) * (TIME_UNITS_PER_SEC / 4)) @@ -155,7 +155,7 @@ RATEEST_final_check(unsigned int flags) } if (info->interval > 5) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "RATEEST: interval value is too large"); info->interval -= 2; @@ -167,7 +167,7 @@ RATEEST_final_check(unsigned int flags) info->ewma_log--; if (info->ewma_log == 0 || info->ewma_log >= 31) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "RATEEST: ewmalog value is out of range"); } diff --git a/extensions/libxt_SECMARK.c b/extensions/libxt_SECMARK.c index c62fb44f..9db2327c 100644 --- a/extensions/libxt_SECMARK.c +++ b/extensions/libxt_SECMARK.c @@ -35,12 +35,12 @@ static int SECMARK_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags & SECMARK_MODE_SEL) - exit_error(PARAMETER_PROBLEM, PFX + xtables_error(PARAMETER_PROBLEM, PFX "Can't specify --selctx twice"); info->mode = SECMARK_MODE_SEL; if (strlen(optarg) > SECMARK_SELCTX_MAX-1) - exit_error(PARAMETER_PROBLEM, PFX + xtables_error(PARAMETER_PROBLEM, PFX "Maximum length %u exceeded by --selctx" " parameter (%zu)", SECMARK_SELCTX_MAX-1, strlen(optarg)); @@ -58,7 +58,7 @@ static int SECMARK_parse(int c, char **argv, int invert, unsigned int *flags, static void SECMARK_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, PFX "parameter required"); + xtables_error(PARAMETER_PROBLEM, PFX "parameter required"); } static void print_secmark(struct xt_secmark_target_info *info) @@ -69,7 +69,7 @@ static void print_secmark(struct xt_secmark_target_info *info) break; default: - exit_error(OTHER_PROBLEM, PFX "invalid mode %hhu\n", info->mode); + xtables_error(OTHER_PROBLEM, PFX "invalid mode %hhu\n", info->mode); } } diff --git a/extensions/libxt_TCPMSS.c b/extensions/libxt_TCPMSS.c index 33fc71cd..ac9e2d0d 100644 --- a/extensions/libxt_TCPMSS.c +++ b/extensions/libxt_TCPMSS.c @@ -53,11 +53,11 @@ static int __TCPMSS_parse(int c, char **argv, int invert, unsigned int *flags, case '1': if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "TCPMSS target: Only one option may be specified"); if (!xtables_strtoui(optarg, NULL, &mssval, 0, UINT16_MAX - hdrsize)) - exit_error(PARAMETER_PROBLEM, "Bad TCPMSS value `%s'", optarg); + xtables_error(PARAMETER_PROBLEM, "Bad TCPMSS value \"%s\"", optarg); mssinfo->mss = mssval; *flags = 1; @@ -65,7 +65,7 @@ static int __TCPMSS_parse(int c, char **argv, int invert, unsigned int *flags, case '2': if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "TCPMSS target: Only one option may be specified"); mssinfo->mss = XT_TCPMSS_CLAMP_PMTU; *flags = 1; @@ -93,7 +93,7 @@ static int TCPMSS_parse6(int c, char **argv, int invert, unsigned int *flags, static void TCPMSS_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "TCPMSS target: At least one parameter is required"); } diff --git a/extensions/libxt_TCPOPTSTRIP.c b/extensions/libxt_TCPOPTSTRIP.c index c053a8b1..cf946fc7 100644 --- a/extensions/libxt_TCPOPTSTRIP.c +++ b/extensions/libxt_TCPOPTSTRIP.c @@ -84,15 +84,15 @@ static void parse_list(struct xt_tcpoptstrip_target_info *info, char *arg) if (option == 0 && !xtables_strtoui(arg, NULL, &option, 0, UINT8_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Bad TCP option value \"%s\"", arg); if (option < 2) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Option value may not be 0 or 1"); if (tcpoptstrip_test_bit(info->strip_bmap, option)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Option \"%s\" already specified", arg); tcpoptstrip_set_bit(info->strip_bmap, option); @@ -111,7 +111,7 @@ static int tcpoptstrip_tg_parse(int c, char **argv, int invert, switch (c) { case 's': if (*flags & FLAG_STRIP) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "You can specify --strip-options only once"); parse_list(info, optarg); *flags |= FLAG_STRIP; @@ -124,7 +124,7 @@ static int tcpoptstrip_tg_parse(int c, char **argv, int invert, static void tcpoptstrip_tg_check(unsigned int flags) { if (flags == 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "TCPOPTSTRIP: --strip-options parameter required"); } diff --git a/extensions/libxt_TOS.c b/extensions/libxt_TOS.c index 7b1f7f83..c08f53bd 100644 --- a/extensions/libxt_TOS.c +++ b/extensions/libxt_TOS.c @@ -87,7 +87,7 @@ static int tos_tg_parse_v0(int c, char **argv, int invert, unsigned int *flags, if (!tos_parse_symbolic(optarg, &tvm, 0xFF)) xtables_param_act(XTF_BAD_VALUE, "TOS", "--set-tos", optarg); if (tvm.mask != 0xFF) - exit_error(PARAMETER_PROBLEM, "tos match: Your kernel " + xtables_error(PARAMETER_PROBLEM, "tos match: Your kernel " "is too old to support anything besides " "/0xFF as a mask."); info->tos = tvm.value; @@ -153,7 +153,7 @@ static int tos_tg_parse(int c, char **argv, int invert, unsigned int *flags, static void tos_tg_check(unsigned int flags) { if (flags == 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "TOS: The --set-tos parameter is required"); } diff --git a/extensions/libxt_TPROXY.c b/extensions/libxt_TPROXY.c index 54ae96d2..d410c52b 100644 --- a/extensions/libxt_TPROXY.c +++ b/extensions/libxt_TPROXY.c @@ -105,7 +105,7 @@ static int tproxy_tg_parse(int c, char **argv, int invert, unsigned int *flags, static void tproxy_tg_check(unsigned int flags) { if (!(flags & PARAM_ONPORT)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "TPROXY target: Parameter --on-port is required"); } diff --git a/extensions/libxt_comment.c b/extensions/libxt_comment.c index 9bad1256..0ff0144d 100644 --- a/extensions/libxt_comment.c +++ b/extensions/libxt_comment.c @@ -32,7 +32,7 @@ parse_comment(const char *s, struct xt_comment_info *info) int slen = strlen(s); if (slen >= XT_MAX_COMMENT_LEN) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "COMMENT must be shorter than %i characters", XT_MAX_COMMENT_LEN); } strcpy((char *)info->comment, s); @@ -48,7 +48,7 @@ comment_parse(int c, char **argv, int invert, unsigned int *flags, case '1': xtables_check_inverse(argv[optind-1], &invert, &optind, 0); if (invert) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Sorry, you can't have an inverted comment"); } parse_comment(argv[optind-1], commentinfo); @@ -64,7 +64,7 @@ comment_parse(int c, char **argv, int invert, unsigned int *flags, static void comment_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "COMMENT match: You must specify `--comment'"); } diff --git a/extensions/libxt_connbytes.c b/extensions/libxt_connbytes.c index 5fc0f2a6..9f6af1cf 100644 --- a/extensions/libxt_connbytes.c +++ b/extensions/libxt_connbytes.c @@ -31,14 +31,14 @@ parse_range(const char *arg, struct xt_connbytes_info *si) si->count.from = strtoul(arg,&colon,10); if (*colon != ':') - exit_error(PARAMETER_PROBLEM, "Bad range `%s'", arg); + xtables_error(PARAMETER_PROBLEM, "Bad range \"%s\"", arg); si->count.to = strtoul(colon+1,&p,10); if (p == colon+1) { /* second number omited */ si->count.to = 0xffffffff; } if (si->count.from > si->count.to) - exit_error(PARAMETER_PROBLEM, "%llu should be less than %llu", + xtables_error(PARAMETER_PROBLEM, "%llu should be less than %llu", (unsigned long long)si->count.from, (unsigned long long)si->count.to); } @@ -71,7 +71,7 @@ connbytes_parse(int c, char **argv, int invert, unsigned int *flags, else if (!strcmp(optarg, "both")) sinfo->direction = XT_CONNBYTES_DIR_BOTH; else - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unknown --connbytes-dir `%s'", optarg); *flags |= 2; @@ -84,7 +84,7 @@ connbytes_parse(int c, char **argv, int invert, unsigned int *flags, else if (!strcmp(optarg, "avgpkt")) sinfo->what = XT_CONNBYTES_AVGPKT; else - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unknown --connbytes-mode `%s'", optarg); *flags |= 4; break; @@ -98,7 +98,7 @@ connbytes_parse(int c, char **argv, int invert, unsigned int *flags, static void connbytes_check(unsigned int flags) { if (flags != 7) - exit_error(PARAMETER_PROBLEM, "You must specify `--connbytes'" + xtables_error(PARAMETER_PROBLEM, "You must specify `--connbytes'" "`--connbytes-dir' and `--connbytes-mode'"); } diff --git a/extensions/libxt_connlimit.c b/extensions/libxt_connlimit.c index f43eada1..f001a2e4 100644 --- a/extensions/libxt_connlimit.c +++ b/extensions/libxt_connlimit.c @@ -60,7 +60,7 @@ static int connlimit_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case 'A': if (*flags & 0x1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--connlimit-above may be given only once"); *flags |= 0x1; xtables_check_inverse(optarg, &invert, &optind, 0); @@ -69,20 +69,20 @@ static int connlimit_parse(int c, char **argv, int invert, unsigned int *flags, break; case 'M': if (*flags & 0x2) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--connlimit-mask may be given only once"); *flags |= 0x2; i = strtoul(argv[optind-1], &err, 0); if (family == NFPROTO_IPV6) { if (i > 128 || *err != '\0') - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--connlimit-mask must be between " "0 and 128"); prefix_to_netmask(info->v6_mask, i); } else { if (i > 32 || *err != '\0') - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--connlimit-mask must be between " "0 and 32"); if (i == 0) @@ -117,7 +117,7 @@ static int connlimit_parse6(int c, char **argv, int invert, static void connlimit_check(unsigned int flags) { if (!(flags & 0x1)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "You must specify \"--connlimit-above\""); } diff --git a/extensions/libxt_connmark.c b/extensions/libxt_connmark.c index d5ca4e0b..2dca5a50 100644 --- a/extensions/libxt_connmark.c +++ b/extensions/libxt_connmark.c @@ -91,7 +91,7 @@ connmark_parse(int c, char **argv, int invert, unsigned int *flags, markinfo->mask = strtoul(end+1, &end, 0); if (*end != '\0' || end == optarg) - exit_error(PARAMETER_PROBLEM, "Bad MARK value `%s'", optarg); + xtables_error(PARAMETER_PROBLEM, "Bad MARK value \"%s\"", optarg); if (invert) markinfo->invert = 1; *flags = 1; @@ -114,7 +114,7 @@ static void print_mark(unsigned int mark, unsigned int mask) static void connmark_mt_check(unsigned int flags) { if (flags == 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "connmark: The --mark option is required"); } diff --git a/extensions/libxt_conntrack.c b/extensions/libxt_conntrack.c index 45783f4d..a3fcafcc 100644 --- a/extensions/libxt_conntrack.c +++ b/extensions/libxt_conntrack.c @@ -103,15 +103,15 @@ parse_states(const char *arg, struct xt_conntrack_info *sinfo) while ((comma = strchr(arg, ',')) != NULL) { if (comma == arg || !parse_state(arg, comma-arg, sinfo)) - exit_error(PARAMETER_PROBLEM, "Bad ctstate `%s'", arg); + xtables_error(PARAMETER_PROBLEM, "Bad ctstate \"%s\"", arg); arg = comma+1; } if (!*arg) - exit_error(PARAMETER_PROBLEM, "`--ctstate' requires a list of " + xtables_error(PARAMETER_PROBLEM, "\"--ctstate\" requires a list of " "states with no spaces, e.g. " "ESTABLISHED,RELATED"); if (strlen(arg) == 0 || !parse_state(arg, strlen(arg), sinfo)) - exit_error(PARAMETER_PROBLEM, "Bad ctstate `%s'", arg); + xtables_error(PARAMETER_PROBLEM, "Bad ctstate \"%s\"", arg); } static bool @@ -144,13 +144,13 @@ conntrack_ps_states(struct xt_conntrack_mtinfo1 *info, const char *arg) while ((comma = strchr(arg, ',')) != NULL) { if (comma == arg || !conntrack_ps_state(info, arg, comma - arg)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Bad ctstate \"%s\"", arg); arg = comma + 1; } if (strlen(arg) == 0 || !conntrack_ps_state(info, arg, strlen(arg))) - exit_error(PARAMETER_PROBLEM, "Bad ctstate \"%s\"", arg); + xtables_error(PARAMETER_PROBLEM, "Bad ctstate \"%s\"", arg); } static int @@ -180,12 +180,12 @@ parse_statuses(const char *arg, struct xt_conntrack_info *sinfo) while ((comma = strchr(arg, ',')) != NULL) { if (comma == arg || !parse_status(arg, comma-arg, sinfo)) - exit_error(PARAMETER_PROBLEM, "Bad ctstatus `%s'", arg); + xtables_error(PARAMETER_PROBLEM, "Bad ctstatus \"%s\"", arg); arg = comma+1; } if (strlen(arg) == 0 || !parse_status(arg, strlen(arg), sinfo)) - exit_error(PARAMETER_PROBLEM, "Bad ctstatus `%s'", arg); + xtables_error(PARAMETER_PROBLEM, "Bad ctstatus \"%s\"", arg); } static bool @@ -214,13 +214,13 @@ conntrack_ps_statuses(struct xt_conntrack_mtinfo1 *info, const char *arg) while ((comma = strchr(arg, ',')) != NULL) { if (comma == arg || !conntrack_ps_status(info, arg, comma - arg)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Bad ctstatus \"%s\"", arg); arg = comma + 1; } if (strlen(arg) == 0 || !conntrack_ps_status(info, arg, strlen(arg))) - exit_error(PARAMETER_PROBLEM, "Bad ctstatus \"%s\"", arg); + xtables_error(PARAMETER_PROBLEM, "Bad ctstatus \"%s\"", arg); } static unsigned long @@ -229,7 +229,7 @@ parse_expire(const char *s) unsigned int len; if (!xtables_strtoui(s, NULL, &len, 0, UINT32_MAX)) - exit_error(PARAMETER_PROBLEM, "expire value invalid: `%s'\n", s); + xtables_error(PARAMETER_PROBLEM, "expire value invalid: \"%s\"\n", s); else return len; } @@ -257,7 +257,7 @@ parse_expires(const char *s, struct xt_conntrack_info *sinfo) free(buffer); if (sinfo->expires_min > sinfo->expires_max) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "expire min. range value `%lu' greater than max. " "range value `%lu'", sinfo->expires_min, sinfo->expires_max); } @@ -278,7 +278,7 @@ conntrack_ps_expires(struct xt_conntrack_mtinfo1 *info, const char *s) xtables_param_act(XTF_BAD_VALUE, "conntrack", "--expires", s); if (min > max) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "expire min. range value \"%u\" greater than max. " "range value \"%u\"", min, max); @@ -322,7 +322,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags, if (sinfo->tuple[IP_CT_DIR_ORIGINAL].dst.protonum == 0 && (sinfo->invflags & XT_INV_PROTO)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rule would never match protocol"); sinfo->flags |= XT_CONNTRACK_PROTO; @@ -338,7 +338,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags, &sinfo->sipmsk[IP_CT_DIR_ORIGINAL], &naddrs); if(naddrs > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiple IP addresses not allowed"); if(naddrs == 1) { @@ -358,7 +358,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags, &sinfo->dipmsk[IP_CT_DIR_ORIGINAL], &naddrs); if(naddrs > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiple IP addresses not allowed"); if(naddrs == 1) { @@ -378,7 +378,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags, &sinfo->sipmsk[IP_CT_DIR_REPLY], &naddrs); if(naddrs > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiple IP addresses not allowed"); if(naddrs == 1) { @@ -398,7 +398,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags, &sinfo->dipmsk[IP_CT_DIR_REPLY], &naddrs); if(naddrs > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiple IP addresses not allowed"); if(naddrs == 1) { @@ -459,7 +459,7 @@ conntrack_mt_parse(int c, char **argv, int invert, unsigned int *flags, info->l4proto = xtables_parse_protocol(optarg); if (info->l4proto == 0 && (info->invert_flags & XT_INV_PROTO)) - exit_error(PARAMETER_PROBLEM, "conntrack: rule would " + xtables_error(PARAMETER_PROBLEM, "conntrack: rule would " "never match protocol"); info->match_flags |= XT_CONNTRACK_PROTO; @@ -555,7 +555,7 @@ conntrack_mt4_parse(int c, char **argv, int invert, unsigned int *flags, xtables_ipparse_any(optarg, &addr, &info->origsrc_mask.in, &naddrs); if (naddrs > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiple IP addresses not allowed"); if (naddrs == 1) memcpy(&info->origsrc_addr.in, addr, sizeof(*addr)); @@ -568,7 +568,7 @@ conntrack_mt4_parse(int c, char **argv, int invert, unsigned int *flags, xtables_ipparse_any(optarg, &addr, &info->origdst_mask.in, &naddrs); if (naddrs > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiple IP addresses not allowed"); if (naddrs == 1) memcpy(&info->origdst_addr.in, addr, sizeof(*addr)); @@ -581,7 +581,7 @@ conntrack_mt4_parse(int c, char **argv, int invert, unsigned int *flags, xtables_ipparse_any(optarg, &addr, &info->replsrc_mask.in, &naddrs); if (naddrs > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiple IP addresses not allowed"); if (naddrs == 1) memcpy(&info->replsrc_addr.in, addr, sizeof(*addr)); @@ -594,7 +594,7 @@ conntrack_mt4_parse(int c, char **argv, int invert, unsigned int *flags, xtables_ipparse_any(optarg, &addr, &info->repldst_mask.in, &naddrs); if (naddrs > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiple IP addresses not allowed"); if (naddrs == 1) memcpy(&info->repldst_addr.in, addr, sizeof(*addr)); @@ -625,7 +625,7 @@ conntrack_mt6_parse(int c, char **argv, int invert, unsigned int *flags, xtables_ip6parse_any(optarg, &addr, &info->origsrc_mask.in6, &naddrs); if (naddrs > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiple IP addresses not allowed"); if (naddrs == 1) memcpy(&info->origsrc_addr.in6, addr, sizeof(*addr)); @@ -638,7 +638,7 @@ conntrack_mt6_parse(int c, char **argv, int invert, unsigned int *flags, xtables_ip6parse_any(optarg, &addr, &info->origdst_mask.in6, &naddrs); if (naddrs > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiple IP addresses not allowed"); if (naddrs == 1) memcpy(&info->origdst_addr.in, addr, sizeof(*addr)); @@ -651,7 +651,7 @@ conntrack_mt6_parse(int c, char **argv, int invert, unsigned int *flags, xtables_ip6parse_any(optarg, &addr, &info->replsrc_mask.in6, &naddrs); if (naddrs > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiple IP addresses not allowed"); if (naddrs == 1) memcpy(&info->replsrc_addr.in, addr, sizeof(*addr)); @@ -664,7 +664,7 @@ conntrack_mt6_parse(int c, char **argv, int invert, unsigned int *flags, xtables_ip6parse_any(optarg, &addr, &info->repldst_mask.in6, &naddrs); if (naddrs > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiple IP addresses not allowed"); if (naddrs == 1) memcpy(&info->repldst_addr.in, addr, sizeof(*addr)); @@ -685,7 +685,7 @@ conntrack_mt6_parse(int c, char **argv, int invert, unsigned int *flags, static void conntrack_mt_check(unsigned int flags) { if (flags == 0) - exit_error(PARAMETER_PROBLEM, "conntrack: At least one option " + xtables_error(PARAMETER_PROBLEM, "conntrack: At least one option " "is required"); } diff --git a/extensions/libxt_dccp.c b/extensions/libxt_dccp.c index dbf6223c..413624e1 100644 --- a/extensions/libxt_dccp.c +++ b/extensions/libxt_dccp.c @@ -72,7 +72,7 @@ parse_dccp_ports(const char *portstring, ports[1] = cp[0] ? xtables_parse_port(cp, "dccp") : 0xFFFF; if (ports[0] > ports[1]) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "invalid portrange (min > max)"); } free(buffer); @@ -109,7 +109,7 @@ parse_dccp_types(const char *typestring) } } if (i == sizeof(dccp_pkt_types)/sizeof(char *)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unknown DCCP type `%s'", ptr); } @@ -122,7 +122,7 @@ static u_int8_t parse_dccp_option(char *optstring) unsigned int ret; if (!xtables_strtoui(optstring, NULL, &ret, 1, UINT8_MAX)) - exit_error(PARAMETER_PROBLEM, "Bad DCCP option `%s'", + xtables_error(PARAMETER_PROBLEM, "Bad DCCP option \"%s\"", optstring); return ret; @@ -138,7 +138,7 @@ dccp_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags & XT_DCCP_SRC_PORTS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--source-port' allowed"); einfo->flags |= XT_DCCP_SRC_PORTS; xtables_check_inverse(optarg, &invert, &optind, 0); @@ -150,7 +150,7 @@ dccp_parse(int c, char **argv, int invert, unsigned int *flags, case '2': if (*flags & XT_DCCP_DEST_PORTS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--destination-port' allowed"); einfo->flags |= XT_DCCP_DEST_PORTS; xtables_check_inverse(optarg, &invert, &optind, 0); @@ -162,7 +162,7 @@ dccp_parse(int c, char **argv, int invert, unsigned int *flags, case '3': if (*flags & XT_DCCP_TYPE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--dccp-types' allowed"); einfo->flags |= XT_DCCP_TYPE; xtables_check_inverse(optarg, &invert, &optind, 0); @@ -174,7 +174,7 @@ dccp_parse(int c, char **argv, int invert, unsigned int *flags, case '4': if (*flags & XT_DCCP_OPTION) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--dccp-option' allowed"); einfo->flags |= XT_DCCP_OPTION; xtables_check_inverse(optarg, &invert, &optind, 0); diff --git a/extensions/libxt_dscp.c b/extensions/libxt_dscp.c index e57c2673..62fa6af5 100644 --- a/extensions/libxt_dscp.c +++ b/extensions/libxt_dscp.c @@ -49,11 +49,11 @@ parse_dscp(const char *s, struct xt_dscp_info *dinfo) unsigned int dscp; if (!xtables_strtoui(s, NULL, &dscp, 0, UINT8_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid dscp `%s'\n", s); if (dscp > XT_DSCP_MAX) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "DSCP `%d` out of range\n", dscp); dinfo->dscp = dscp; @@ -80,7 +80,7 @@ dscp_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case 'F': if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "DSCP match: Only use --dscp ONCE!"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_dscp(argv[optind-1], dinfo); @@ -91,7 +91,7 @@ dscp_parse(int c, char **argv, int invert, unsigned int *flags, case 'G': if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "DSCP match: Only use --dscp-class ONCE!"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_class(argv[optind - 1], dinfo); @@ -110,7 +110,7 @@ dscp_parse(int c, char **argv, int invert, unsigned int *flags, static void dscp_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "DSCP match: Parameter --dscp is required"); } diff --git a/extensions/libxt_esp.c b/extensions/libxt_esp.c index 2cc6b60f..5769edb5 100644 --- a/extensions/libxt_esp.c +++ b/extensions/libxt_esp.c @@ -32,15 +32,15 @@ parse_esp_spi(const char *spistr) spi = strtoul(spistr,&ep,0) ; if ( spistr == ep ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ESP no valid digits in spi `%s'", spistr); } if ( spi == ULONG_MAX && errno == ERANGE ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "spi `%s' specified too big: would overflow", spistr); } if ( *spistr != '\0' && *ep != '\0' ) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "ESP error parsing spi `%s'", spistr); } return spi; @@ -62,7 +62,7 @@ parse_esp_spis(const char *spistring, u_int32_t *spis) spis[0] = buffer[0] ? parse_esp_spi(buffer) : 0; spis[1] = cp[0] ? parse_esp_spi(cp) : 0xFFFFFFFF; if (spis[0] > spis[1]) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid ESP spi range: %s", spistring); } free(buffer); @@ -86,7 +86,7 @@ esp_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags & ESP_SPI) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--espspi' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_esp_spis(argv[optind-1], espinfo->spis); diff --git a/extensions/libxt_hashlimit.c b/extensions/libxt_hashlimit.c index b05e8c8c..5377b6d8 100644 --- a/extensions/libxt_hashlimit.c +++ b/extensions/libxt_hashlimit.c @@ -124,7 +124,7 @@ int parse_rate(const char *rate, u_int32_t *val) /* This would get mapped to infinite (1/day is minimum they can specify, so we're ok at that end). */ if (r / mult > XT_HASHLIMIT_SCALE) - exit_error(PARAMETER_PROBLEM, "Rate too fast `%s'\n", rate); + xtables_error(PARAMETER_PROBLEM, "Rate too fast \"%s\"\n", rate); *val = XT_HASHLIMIT_SCALE * mult / r; return 1; @@ -221,7 +221,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags, *flags & PARAM_LIMIT); if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break; if (!parse_rate(optarg, &r->cfg.avg)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "bad rate `%s'", optarg); *flags |= PARAM_LIMIT; break; @@ -231,7 +231,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags, *flags & PARAM_BURST); if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break; if (!xtables_strtoui(optarg, NULL, &num, 0, 10000)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "bad --hashlimit-burst `%s'", optarg); r->cfg.burst = num; *flags |= PARAM_BURST; @@ -241,7 +241,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags, *flags & PARAM_SIZE); if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break; if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "bad --hashlimit-htable-size: `%s'", optarg); r->cfg.size = num; *flags |= PARAM_SIZE; @@ -251,7 +251,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags, *flags & PARAM_MAX); if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break; if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "bad --hashlimit-htable-max: `%s'", optarg); r->cfg.max = num; *flags |= PARAM_MAX; @@ -262,7 +262,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags, *flags & PARAM_GCINTERVAL); if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break; if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "bad --hashlimit-htable-gcinterval: `%s'", optarg); /* FIXME: not HZ dependent!! */ @@ -274,7 +274,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags, "--hashlimit-htable-expire", *flags & PARAM_EXPIRE); if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break; if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "bad --hashlimit-htable-expire: `%s'", optarg); /* FIXME: not HZ dependent */ r->cfg.expire = num; @@ -285,7 +285,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags, *flags & PARAM_MODE); if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break; if (parse_mode(&r->cfg.mode, optarg) < 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "bad --hashlimit-mode: `%s'\n", optarg); *flags |= PARAM_MODE; break; @@ -294,7 +294,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags, *flags & PARAM_NAME); if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break; if (strlen(optarg) == 0) - exit_error(PARAMETER_PROBLEM, "Zero-length name?"); + xtables_error(PARAMETER_PROBLEM, "Zero-length name?"); strncpy(r->name, optarg, sizeof(r->name)); *flags |= PARAM_NAME; break; @@ -303,7 +303,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags, } if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "hashlimit does not support invert"); return 1; @@ -404,7 +404,7 @@ hashlimit_mt_parse(struct xt_hashlimit_mtinfo1 *info, unsigned int *flags, xtables_param_act(XTF_ONLY_ONCE, "hashlimit", "--hashlimit-name", *flags & PARAM_NAME); if (strlen(optarg) == 0) - exit_error(PARAMETER_PROBLEM, "Zero-length name?"); + xtables_error(PARAMETER_PROBLEM, "Zero-length name?"); strncpy(info->name, optarg, sizeof(info->name)); info->name[sizeof(info->name)-1] = '\0'; *flags |= PARAM_NAME; @@ -452,23 +452,23 @@ hashlimit_mt6_parse(int c, char **argv, int invert, unsigned int *flags, static void hashlimit_check(unsigned int flags) { if (!(flags & PARAM_LIMIT)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "You have to specify --hashlimit"); if (!(flags & PARAM_MODE)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "You have to specify --hashlimit-mode"); if (!(flags & PARAM_NAME)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "You have to specify --hashlimit-name"); } static void hashlimit_mt_check(unsigned int flags) { if (!(flags & PARAM_LIMIT)) - exit_error(PARAMETER_PROBLEM, "You have to specify " + xtables_error(PARAMETER_PROBLEM, "You have to specify " "--hashlimit-upto or --hashlimit-above"); if (!(flags & PARAM_NAME)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "You have to specify --hashlimit-name"); } diff --git a/extensions/libxt_helper.c b/extensions/libxt_helper.c index 569ad69e..8378be75 100644 --- a/extensions/libxt_helper.c +++ b/extensions/libxt_helper.c @@ -29,7 +29,7 @@ helper_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "helper match: Only use --helper ONCE!"); xtables_check_inverse(optarg, &invert, &invert, 0); strncpy(info->name, optarg, 29); @@ -48,7 +48,7 @@ helper_parse(int c, char **argv, int invert, unsigned int *flags, static void helper_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "helper match: You must specify `--helper'"); } diff --git a/extensions/libxt_iprange.c b/extensions/libxt_iprange.c index df6be14f..bc5b2aeb 100644 --- a/extensions/libxt_iprange.c +++ b/extensions/libxt_iprange.c @@ -42,14 +42,14 @@ parse_iprange(char *arg, struct ipt_iprange *range) ip = xtables_numeric_to_ipaddr(arg); if (!ip) - exit_error(PARAMETER_PROBLEM, "iprange match: Bad IP address `%s'\n", + xtables_error(PARAMETER_PROBLEM, "iprange match: Bad IP address \"%s\"\n", arg); range->min_ip = ip->s_addr; if (dash != NULL) { ip = xtables_numeric_to_ipaddr(dash+1); if (!ip) - exit_error(PARAMETER_PROBLEM, "iprange match: Bad IP address `%s'\n", + xtables_error(PARAMETER_PROBLEM, "iprange match: Bad IP address \"%s\"\n", dash+1); range->max_ip = ip->s_addr; } else { @@ -65,7 +65,7 @@ static int iprange_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags & IPRANGE_SRC) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "iprange match: Only use --src-range ONCE!"); *flags |= IPRANGE_SRC; @@ -79,7 +79,7 @@ static int iprange_parse(int c, char **argv, int invert, unsigned int *flags, case '2': if (*flags & IPRANGE_DST) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "iprange match: Only use --dst-range ONCE!"); *flags |= IPRANGE_DST; @@ -201,7 +201,7 @@ iprange_mt6_parse(int c, char **argv, int invert, unsigned int *flags, static void iprange_mt_check(unsigned int flags) { if (flags == 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "iprange match: You must specify `--src-range' or `--dst-range'"); } diff --git a/extensions/libxt_length.c b/extensions/libxt_length.c index cf944e2d..7bb31a83 100644 --- a/extensions/libxt_length.c +++ b/extensions/libxt_length.c @@ -27,7 +27,7 @@ parse_length(const char *s) unsigned int len; if (!xtables_strtoui(s, NULL, &len, 0, UINT32_MAX)) - exit_error(PARAMETER_PROBLEM, "length invalid: `%s'\n", s); + xtables_error(PARAMETER_PROBLEM, "length invalid: \"%s\"\n", s); else return len; } @@ -52,7 +52,7 @@ parse_lengths(const char *s, struct xt_length_info *info) free(buffer); if (info->min > info->max) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "length min. range value `%u' greater than max. " "range value `%u'", info->min, info->max); @@ -67,7 +67,7 @@ length_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "length: `--length' may only be " "specified once"); xtables_check_inverse(optarg, &invert, &optind, 0); @@ -86,7 +86,7 @@ length_parse(int c, char **argv, int invert, unsigned int *flags, static void length_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "length: You must specify `--length'"); } diff --git a/extensions/libxt_limit.c b/extensions/libxt_limit.c index 7edfa3db..f785d2df 100644 --- a/extensions/libxt_limit.c +++ b/extensions/libxt_limit.c @@ -64,7 +64,7 @@ int parse_rate(const char *rate, u_int32_t *val) /* This would get mapped to infinite (1/day is minimum they can specify, so we're ok at that end). */ if (r / mult > XT_LIMIT_SCALE) - exit_error(PARAMETER_PROBLEM, "Rate too fast `%s'\n", rate); + xtables_error(PARAMETER_PROBLEM, "Rate too fast \"%s\"\n", rate); *val = XT_LIMIT_SCALE * mult / r; return 1; @@ -81,7 +81,7 @@ static void limit_init(struct xt_entry_match *m) /* FIXME: handle overflow: if (r->avg*r->burst/r->burst != r->avg) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Sorry: burst too large for that avg rate.\n"); */ @@ -96,14 +96,14 @@ limit_parse(int c, char **argv, int invert, unsigned int *flags, case '%': if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break; if (!parse_rate(optarg, &r->avg)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "bad rate `%s'", optarg); break; case '$': if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break; if (!xtables_strtoui(optarg, NULL, &num, 0, 10000)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "bad --limit-burst `%s'", optarg); r->burst = num; break; @@ -113,7 +113,7 @@ limit_parse(int c, char **argv, int invert, unsigned int *flags, } if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "limit does not support invert"); return 1; diff --git a/extensions/libxt_mac.c b/extensions/libxt_mac.c index b516d80f..a57e3410 100644 --- a/extensions/libxt_mac.c +++ b/extensions/libxt_mac.c @@ -31,7 +31,7 @@ parse_mac(const char *mac, struct xt_mac_info *info) unsigned int i = 0; if (strlen(mac) != ETH_ALEN*3-1) - exit_error(PARAMETER_PROBLEM, "Bad mac address `%s'", mac); + xtables_error(PARAMETER_PROBLEM, "Bad mac address \"%s\"", mac); for (i = 0; i < ETH_ALEN; i++) { long number; @@ -44,7 +44,7 @@ parse_mac(const char *mac, struct xt_mac_info *info) && number <= 255) info->srcaddr[i] = number; else - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Bad mac address `%s'", mac); } } @@ -84,7 +84,7 @@ static void print_mac(const unsigned char macaddress[ETH_ALEN]) static void mac_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "You must specify `--mac-source'"); } diff --git a/extensions/libxt_mark.c b/extensions/libxt_mark.c index 1143ba98..ceca9952 100644 --- a/extensions/libxt_mark.c +++ b/extensions/libxt_mark.c @@ -69,7 +69,7 @@ mark_parse(int c, char **argv, int invert, unsigned int *flags, } else markinfo->mask = 0xffffffff; if (*end != '\0' || end == optarg) - exit_error(PARAMETER_PROBLEM, "Bad MARK value `%s'", optarg); + xtables_error(PARAMETER_PROBLEM, "Bad MARK value \"%s\"", optarg); if (invert) markinfo->invert = 1; *flags = 1; @@ -92,7 +92,7 @@ static void print_mark(unsigned int mark, unsigned int mask) static void mark_mt_check(unsigned int flags) { if (flags == 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "mark match: The --mark option is required"); } diff --git a/extensions/libxt_multiport.c b/extensions/libxt_multiport.c index d0e830df..81414417 100644 --- a/extensions/libxt_multiport.c +++ b/extensions/libxt_multiport.c @@ -75,7 +75,7 @@ parse_multi_ports(const char *portstring, u_int16_t *ports, const char *proto) unsigned int i; buffer = strdup(portstring); - if (!buffer) exit_error(OTHER_PROBLEM, "strdup failed"); + if (!buffer) xtables_error(OTHER_PROBLEM, "strdup failed"); for (cp=buffer, i=0; cp && ipflags[i] = 0; @@ -109,7 +109,7 @@ parse_multi_ports_v1(const char *portstring, range = strchr(cp, ':'); if (range) { if (i == XT_MULTI_PORTS-1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "too many ports specified"); *range++ = '\0'; } @@ -118,13 +118,13 @@ parse_multi_ports_v1(const char *portstring, multiinfo->pflags[i] = 1; multiinfo->ports[++i] = xtables_parse_port(range, proto); if (multiinfo->ports[i-1] >= multiinfo->ports[i]) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "invalid portrange specified"); m <<= 1; } } multiinfo->count = i; - if (cp) exit_error(PARAMETER_PROBLEM, "too many ports specified"); + if (cp) xtables_error(PARAMETER_PROBLEM, "too many ports specified"); free(buffer); } @@ -134,17 +134,17 @@ check_proto(u_int16_t pnum, u_int8_t invflags) char *proto; if (invflags & XT_INV_PROTO) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiport only works with TCP, UDP, UDPLITE, SCTP and DCCP"); if ((proto = proto_to_name(pnum)) != NULL) return proto; else if (!pnum) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiport needs `-p tcp', `-p udp', `-p udplite', " "`-p sctp' or `-p dccp'"); else - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiport only works with TCP, UDP, UDPLITE, SCTP and DCCP"); } @@ -189,11 +189,11 @@ __multiport_parse(int c, char **argv, int invert, unsigned int *flags, } if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiport does not support invert"); if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiport can only have one option"); *flags = 1; return 1; @@ -256,7 +256,7 @@ __multiport_parse_v1(int c, char **argv, int invert, unsigned int *flags, multiinfo->invert = 1; if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiport can only have one option"); *flags = 1; return 1; @@ -284,7 +284,7 @@ multiport_parse6_v1(int c, char **argv, int invert, unsigned int *flags, static void multiport_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, "multiport expection an option"); + xtables_error(PARAMETER_PROBLEM, "multiport expection an option"); } static char * diff --git a/extensions/libxt_owner.c b/extensions/libxt_owner.c index bf26f35c..d27b3ae5 100644 --- a/extensions/libxt_owner.c +++ b/extensions/libxt_owner.c @@ -163,7 +163,7 @@ owner_mt_parse_v0(int c, char **argv, int invert, unsigned int *flags, case 'c': xtables_param_act(XTF_ONLY_ONCE, "owner", "--cmd-owner", *flags & FLAG_COMM); if (strlen(optarg) > sizeof(info->comm)) - exit_error(PARAMETER_PROBLEM, "owner match: command " + xtables_error(PARAMETER_PROBLEM, "owner match: command " "\"%s\" too long, max. %zu characters", optarg, sizeof(info->comm)); @@ -316,7 +316,7 @@ static int owner_mt_parse(int c, char **argv, int invert, unsigned int *flags, static void owner_mt_check(unsigned int flags) { if (flags == 0) - exit_error(PARAMETER_PROBLEM, "owner: At least one of " + xtables_error(PARAMETER_PROBLEM, "owner: At least one of " "--uid-owner, --gid-owner or --socket-exists " "is required"); } diff --git a/extensions/libxt_physdev.c b/extensions/libxt_physdev.c index 4275a1a4..c87779bb 100644 --- a/extensions/libxt_physdev.c +++ b/extensions/libxt_physdev.c @@ -100,7 +100,7 @@ physdev_parse(int c, char **argv, int invert, unsigned int *flags, return 1; multiple_use: - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "multiple use of the same physdev option is not allowed"); } @@ -108,7 +108,7 @@ multiple_use: static void physdev_check(unsigned int flags) { if (flags == 0) - exit_error(PARAMETER_PROBLEM, "PHYSDEV: no physdev option specified"); + xtables_error(PARAMETER_PROBLEM, "PHYSDEV: no physdev option specified"); } static void diff --git a/extensions/libxt_pkttype.c b/extensions/libxt_pkttype.c index 8caba91e..0fa933fe 100644 --- a/extensions/libxt_pkttype.c +++ b/extensions/libxt_pkttype.c @@ -80,7 +80,7 @@ static void parse_pkttype(const char *pkttype, struct xt_pkttype_info *info) } } - exit_error(PARAMETER_PROBLEM, "Bad packet type '%s'", pkttype); + xtables_error(PARAMETER_PROBLEM, "Bad packet type '%s'", pkttype); } static int pkttype_parse(int c, char **argv, int invert, unsigned int *flags, @@ -108,7 +108,7 @@ static int pkttype_parse(int c, char **argv, int invert, unsigned int *flags, static void pkttype_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, "You must specify `--pkt-type'"); + xtables_error(PARAMETER_PROBLEM, "You must specify \"--pkt-type\""); } static void print_pkttype(struct xt_pkttype_info *info) diff --git a/extensions/libxt_quota.c b/extensions/libxt_quota.c index 8c91fb8e..2657b2a7 100644 --- a/extensions/libxt_quota.c +++ b/extensions/libxt_quota.c @@ -47,7 +47,7 @@ parse_quota(const char *s, u_int64_t * quota) #endif if (*quota == UINT64_MAX) - exit_error(PARAMETER_PROBLEM, "quota invalid: '%s'\n", s); + xtables_error(PARAMETER_PROBLEM, "quota invalid: '%s'\n", s); else return 1; } @@ -61,9 +61,9 @@ quota_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (xtables_check_inverse(optarg, &invert, NULL, 0)) - exit_error(PARAMETER_PROBLEM, "quota: unexpected '!'"); + xtables_error(PARAMETER_PROBLEM, "quota: unexpected '!'"); if (!parse_quota(optarg, &info->quota)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "bad quota: '%s'", optarg); break; diff --git a/extensions/libxt_rateest.c b/extensions/libxt_rateest.c index 8a8836bf..3cff07d0 100644 --- a/extensions/libxt_rateest.c +++ b/extensions/libxt_rateest.c @@ -120,11 +120,11 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags, case OPT_RATEEST1: xtables_check_inverse(optarg, &invert, &optind, 0); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: rateest can't be inverted"); if (*flags & (1 << c)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: can't specify --rateest1 twice"); *flags |= 1 << c; @@ -134,11 +134,11 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags, case OPT_RATEEST2: xtables_check_inverse(optarg, &invert, &optind, 0); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: rateest can't be inverted"); if (*flags & (1 << c)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: can't specify --rateest2 twice"); *flags |= 1 << c; @@ -149,11 +149,11 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags, case OPT_RATEEST_BPS1: xtables_check_inverse(optarg, &invert, &optind, 0); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: rateest-bps can't be inverted"); if (*flags & (1 << c)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: can't specify --rateest-bps1 twice"); *flags |= 1 << c; @@ -164,7 +164,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags, break; if (rateest_get_rate(&info->bps1, argv[optind]) < 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: could not parse rate `%s'", argv[optind]); optind++; @@ -173,11 +173,11 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags, case OPT_RATEEST_PPS1: xtables_check_inverse(optarg, &invert, &optind, 0); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: rateest-pps can't be inverted"); if (*flags & (1 << c)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: can't specify --rateest-pps1 twice"); *flags |= 1 << c; @@ -188,7 +188,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags, break; if (!xtables_strtoui(argv[optind], NULL, &val, 0, UINT32_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: could not parse pps `%s'", argv[optind]); info->pps1 = val; @@ -198,11 +198,11 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags, case OPT_RATEEST_BPS2: xtables_check_inverse(optarg, &invert, &optind, 0); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: rateest-bps can't be inverted"); if (*flags & (1 << c)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: can't specify --rateest-bps2 twice"); *flags |= 1 << c; @@ -213,7 +213,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags, break; if (rateest_get_rate(&info->bps2, argv[optind]) < 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: could not parse rate `%s'", argv[optind]); optind++; @@ -222,11 +222,11 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags, case OPT_RATEEST_PPS2: xtables_check_inverse(optarg, &invert, &optind, 0); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: rateest-pps can't be inverted"); if (*flags & (1 << c)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: can't specify --rateest-pps2 twice"); *flags |= 1 << c; @@ -237,7 +237,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags, break; if (!xtables_strtoui(argv[optind], NULL, &val, 0, UINT32_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: could not parse pps `%s'", argv[optind]); info->pps2 = val; @@ -247,11 +247,11 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags, case OPT_RATEEST_DELTA: xtables_check_inverse(optarg, &invert, &optind, 0); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: rateest-delta can't be inverted"); if (*flags & (1 << c)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: can't specify --rateest-delta twice"); *flags |= 1 << c; @@ -262,7 +262,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags, xtables_check_inverse(argv[optind-1], &invert, &optind, 0); if (*flags & (1 << c)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: can't specify lt/gt/eq twice"); *flags |= 1 << c; @@ -275,7 +275,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags, xtables_check_inverse(argv[optind-1], &invert, &optind, 0); if (*flags & (1 << c)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: can't specify lt/gt/eq twice"); *flags |= 1 << c; @@ -288,7 +288,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags, xtables_check_inverse(argv[optind-1], &invert, &optind, 0); if (*flags & (1 << c)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "rateest: can't specify lt/gt/eq twice"); *flags |= 1 << c; @@ -310,7 +310,7 @@ rateest_final_check(unsigned int flags) struct xt_rateest_match_info *info = rateest_info; if (info == NULL) - exit_error(PARAMETER_PROBLEM, "rateest match: " + xtables_error(PARAMETER_PROBLEM, "rateest match: " "you need to specify some flags"); if (!(info->flags & XT_RATEEST_MATCH_REL)) info->flags |= XT_RATEEST_MATCH_ABS; diff --git a/extensions/libxt_recent.c b/extensions/libxt_recent.c index 1646705f..47c35ff7 100644 --- a/extensions/libxt_recent.c +++ b/extensions/libxt_recent.c @@ -70,7 +70,7 @@ static int recent_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case 201: if (*flags & RECENT_CMDS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "recent: only one of `--set', `--rcheck' " "`--update' or `--remove' may be set"); xtables_check_inverse(optarg, &invert, &optind, 0); @@ -81,7 +81,7 @@ static int recent_parse(int c, char **argv, int invert, unsigned int *flags, case 202: if (*flags & RECENT_CMDS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "recent: only one of `--set', `--rcheck' " "`--update' or `--remove' may be set"); xtables_check_inverse(optarg, &invert, &optind, 0); @@ -92,7 +92,7 @@ static int recent_parse(int c, char **argv, int invert, unsigned int *flags, case 203: if (*flags & RECENT_CMDS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "recent: only one of `--set', `--rcheck' " "`--update' or `--remove' may be set"); xtables_check_inverse(optarg, &invert, &optind, 0); @@ -103,7 +103,7 @@ static int recent_parse(int c, char **argv, int invert, unsigned int *flags, case 206: if (*flags & RECENT_CMDS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "recent: only one of `--set', `--rcheck' " "`--update' or `--remove' may be set"); xtables_check_inverse(optarg, &invert, &optind, 0); @@ -148,12 +148,12 @@ static int recent_parse(int c, char **argv, int invert, unsigned int *flags, static void recent_check(unsigned int flags) { if (!(flags & RECENT_CMDS)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "recent: you must specify one of `--set', `--rcheck' " "`--update' or `--remove'"); if ((flags & XT_RECENT_TTL) && (flags & (XT_RECENT_SET | XT_RECENT_REMOVE))) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "recent: --rttl may only be used with --rcheck or " "--update"); } diff --git a/extensions/libxt_sctp.c b/extensions/libxt_sctp.c index 2ee48610..b889406b 100644 --- a/extensions/libxt_sctp.c +++ b/extensions/libxt_sctp.c @@ -95,7 +95,7 @@ parse_sctp_ports(const char *portstring, ports[1] = cp[0] ? xtables_parse_port(cp, "sctp") : 0xFFFF; if (ports[0] > ports[1]) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "invalid portrange (min > max)"); } free(buffer); @@ -151,7 +151,7 @@ save_chunk_flag_info(struct xt_sctp_flag_info *flag_info, } if (*flag_count == XT_NUM_SCTP_FLAGS) { - exit_error (PARAMETER_PROBLEM, + xtables_error (PARAMETER_PROBLEM, "Number of chunk types with flags exceeds currently allowed limit." "Increasing this limit involves changing IPT_NUM_SCTP_FLAGS and" "recompiling both the kernel space and user space modules\n"); @@ -208,7 +208,7 @@ parse_sctp_chunk(struct xt_sctp_info *einfo, } } if (!found) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unknown sctp chunk `%s'", ptr); if (chunk_flags) { @@ -226,7 +226,7 @@ parse_sctp_chunk(struct xt_sctp_info *einfo, &(einfo->flag_count), i, bit, isupper(chunk_flags[j])); } else { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid flags for chunk type %d\n", i); } } @@ -249,7 +249,7 @@ parse_sctp_chunks(struct xt_sctp_info *einfo, } else if (!strcasecmp(match_type, "ONLY")) { einfo->chunk_match_type = SCTP_CHUNK_MATCH_ONLY; } else { - exit_error (PARAMETER_PROBLEM, + xtables_error (PARAMETER_PROBLEM, "Match type has to be one of \"ALL\", \"ANY\" or \"ONLY\""); } @@ -267,7 +267,7 @@ sctp_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags & XT_SCTP_SRC_PORTS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--source-port' allowed"); einfo->flags |= XT_SCTP_SRC_PORTS; xtables_check_inverse(optarg, &invert, &optind, 0); @@ -279,7 +279,7 @@ sctp_parse(int c, char **argv, int invert, unsigned int *flags, case '2': if (*flags & XT_SCTP_DEST_PORTS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--destination-port' allowed"); einfo->flags |= XT_SCTP_DEST_PORTS; xtables_check_inverse(optarg, &invert, &optind, 0); @@ -291,13 +291,13 @@ sctp_parse(int c, char **argv, int invert, unsigned int *flags, case '3': if (*flags & XT_SCTP_CHUNK_TYPES) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--chunk-types' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); if (!argv[optind] || argv[optind][0] == '-' || argv[optind][0] == '!') - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--chunk-types requires two args"); einfo->flags |= XT_SCTP_CHUNK_TYPES; diff --git a/extensions/libxt_state.c b/extensions/libxt_state.c index 51822303..0f264439 100644 --- a/extensions/libxt_state.c +++ b/extensions/libxt_state.c @@ -51,15 +51,15 @@ state_parse_states(const char *arg, struct xt_state_info *sinfo) while ((comma = strchr(arg, ',')) != NULL) { if (comma == arg || !state_parse_state(arg, comma-arg, sinfo)) - exit_error(PARAMETER_PROBLEM, "Bad state `%s'", arg); + xtables_error(PARAMETER_PROBLEM, "Bad state \"%s\"", arg); arg = comma+1; } if (!*arg) - exit_error(PARAMETER_PROBLEM, "`--state' requires a list of " + xtables_error(PARAMETER_PROBLEM, "\"--state\" requires a list of " "states with no spaces, e.g. " "ESTABLISHED,RELATED"); if (strlen(arg) == 0 || !state_parse_state(arg, strlen(arg), sinfo)) - exit_error(PARAMETER_PROBLEM, "Bad state `%s'", arg); + xtables_error(PARAMETER_PROBLEM, "Bad state \"%s\"", arg); } static int @@ -89,7 +89,7 @@ state_parse(int c, char **argv, int invert, unsigned int *flags, static void state_final_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, "You must specify `--state'"); + xtables_error(PARAMETER_PROBLEM, "You must specify \"--state\""); } static void state_print_state(unsigned int statemask) diff --git a/extensions/libxt_statistic.c b/extensions/libxt_statistic.c index 574f8f7d..fa044adf 100644 --- a/extensions/libxt_statistic.c +++ b/extensions/libxt_statistic.c @@ -49,42 +49,42 @@ statistic_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags & 0x1) - exit_error(PARAMETER_PROBLEM, "double --mode"); + xtables_error(PARAMETER_PROBLEM, "double --mode"); if (!strcmp(optarg, "random")) info->mode = XT_STATISTIC_MODE_RANDOM; else if (!strcmp(optarg, "nth")) info->mode = XT_STATISTIC_MODE_NTH; else - exit_error(PARAMETER_PROBLEM, "Bad mode `%s'", optarg); + xtables_error(PARAMETER_PROBLEM, "Bad mode \"%s\"", optarg); *flags |= 0x1; break; case '2': if (*flags & 0x2) - exit_error(PARAMETER_PROBLEM, "double --probability"); + xtables_error(PARAMETER_PROBLEM, "double --probability"); prob = atof(optarg); if (prob < 0 || prob > 1) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--probability must be between 0 and 1"); info->u.random.probability = 0x80000000 * prob; *flags |= 0x2; break; case '3': if (*flags & 0x4) - exit_error(PARAMETER_PROBLEM, "double --every"); + xtables_error(PARAMETER_PROBLEM, "double --every"); if (!xtables_strtoui(optarg, NULL, &val, 0, UINT32_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "cannot parse --every `%s'", optarg); info->u.nth.every = val; if (info->u.nth.every == 0) - exit_error(PARAMETER_PROBLEM, "--every cannot be 0"); + xtables_error(PARAMETER_PROBLEM, "--every cannot be 0"); info->u.nth.every--; *flags |= 0x4; break; case '4': if (*flags & 0x8) - exit_error(PARAMETER_PROBLEM, "double --packet"); + xtables_error(PARAMETER_PROBLEM, "double --packet"); if (!xtables_strtoui(optarg, NULL, &val, 0, UINT32_MAX)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "cannot parse --packet `%s'", optarg); info->u.nth.packet = val; *flags |= 0x8; @@ -98,25 +98,25 @@ statistic_parse(int c, char **argv, int invert, unsigned int *flags, static void statistic_check(unsigned int flags) { if (!(flags & 0x1)) - exit_error(PARAMETER_PROBLEM, "no mode specified"); + xtables_error(PARAMETER_PROBLEM, "no mode specified"); if ((flags & 0x2) && (flags & (0x4 | 0x8))) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "both nth and random parameters given"); if (flags & 0x2 && global_info->mode != XT_STATISTIC_MODE_RANDOM) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--probability can only be used in random mode"); if (flags & 0x4 && global_info->mode != XT_STATISTIC_MODE_NTH) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--every can only be used in nth mode"); if (flags & 0x8 && global_info->mode != XT_STATISTIC_MODE_NTH) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--packet can only be used in nth mode"); if ((flags & 0x8) && !(flags & 0x4)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--packet can only be used with --every"); /* at this point, info->u.nth.every have been decreased. */ if (global_info->u.nth.packet > global_info->u.nth.every) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "the --packet p must be 0 <= p <= n-1"); diff --git a/extensions/libxt_string.c b/extensions/libxt_string.c index aa52fa8d..5ea529e4 100644 --- a/extensions/libxt_string.c +++ b/extensions/libxt_string.c @@ -69,7 +69,7 @@ parse_string(const char *s, struct xt_string_info *info) info->patlen = strlen(s); return; } - exit_error(PARAMETER_PROBLEM, "STRING too long `%s'", s); + xtables_error(PARAMETER_PROBLEM, "STRING too long \"%s\"", s); } static void @@ -79,7 +79,7 @@ parse_algo(const char *s, struct xt_string_info *info) strncpy(info->algo, s, XT_STRING_MAX_ALGO_NAME_SIZE); return; } - exit_error(PARAMETER_PROBLEM, "ALGO too long `%s'", s); + xtables_error(PARAMETER_PROBLEM, "ALGO too long \"%s\"", s); } static void @@ -92,7 +92,7 @@ parse_hex_string(const char *s, struct xt_string_info *info) slen = strlen(s); if (slen == 0) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "STRING must contain at least one char"); } @@ -100,7 +100,7 @@ parse_hex_string(const char *s, struct xt_string_info *info) if (s[i] == '\\' && !hex_f) { literal_f = 1; } else if (s[i] == '\\') { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Cannot include literals in hex data"); } else if (s[i] == '|') { if (hex_f) @@ -119,7 +119,7 @@ parse_hex_string(const char *s, struct xt_string_info *info) if (literal_f) { if (i+1 >= slen) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Bad literal placement at end of string"); } info->pattern[sindex] = s[i+1]; @@ -127,22 +127,22 @@ parse_hex_string(const char *s, struct xt_string_info *info) literal_f = 0; } else if (hex_f) { if (i+1 >= slen) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Odd number of hex digits"); } if (i+2 >= slen) { /* must end with a "|" */ - exit_error(PARAMETER_PROBLEM, "Invalid hex block"); + xtables_error(PARAMETER_PROBLEM, "Invalid hex block"); } if (! isxdigit(s[i])) /* check for valid hex char */ - exit_error(PARAMETER_PROBLEM, "Invalid hex char `%c'", s[i]); + xtables_error(PARAMETER_PROBLEM, "Invalid hex char '%c'", s[i]); if (! isxdigit(s[i+1])) /* check for valid hex char */ - exit_error(PARAMETER_PROBLEM, "Invalid hex char `%c'", s[i+1]); + xtables_error(PARAMETER_PROBLEM, "Invalid hex char '%c'", s[i+1]); hextmp[0] = s[i]; hextmp[1] = s[i+1]; hextmp[2] = '\0'; if (! sscanf(hextmp, "%x", &schar)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid hex char `%c'", s[i]); info->pattern[sindex] = (char) schar; if (s[i+2] == ' ') @@ -154,7 +154,7 @@ parse_hex_string(const char *s, struct xt_string_info *info) i++; } if (sindex > XT_STRING_MAX_PATTERN_SIZE) - exit_error(PARAMETER_PROBLEM, "STRING too long `%s'", s); + xtables_error(PARAMETER_PROBLEM, "STRING too long \"%s\"", s); sindex++; } info->patlen = sindex; @@ -177,28 +177,28 @@ string_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags & FROM) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify multiple --from"); stringinfo->from_offset = atoi(optarg); *flags |= FROM; break; case '2': if (*flags & TO) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify multiple --to"); stringinfo->to_offset = atoi(optarg); *flags |= TO; break; case '3': if (*flags & ALGO) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify multiple --algo"); parse_algo(optarg, stringinfo); *flags |= ALGO; break; case '4': if (*flags & STRING) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify multiple --string"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_string(argv[optind-1], stringinfo); @@ -215,7 +215,7 @@ string_parse(int c, char **argv, int invert, unsigned int *flags, case '5': if (*flags & STRING) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can't specify multiple --hex-string"); xtables_check_inverse(optarg, &invert, &optind, 0); @@ -231,7 +231,7 @@ string_parse(int c, char **argv, int invert, unsigned int *flags, case '6': if (revision == 0) - exit_error(VERSION_PROBLEM, + xtables_error(VERSION_PROBLEM, "Kernel doesn't support --icase"); stringinfo->u.v1.flags |= XT_STRING_FLAG_IGNORECASE; @@ -247,11 +247,11 @@ string_parse(int c, char **argv, int invert, unsigned int *flags, static void string_check(unsigned int flags) { if (!(flags & STRING)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "STRING match: You must specify `--string' or " "`--hex-string'"); if (!(flags & ALGO)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "STRING match: You must specify `--algo'"); } diff --git a/extensions/libxt_tcp.c b/extensions/libxt_tcp.c index 069bb7fa..d2ad53b3 100644 --- a/extensions/libxt_tcp.c +++ b/extensions/libxt_tcp.c @@ -53,7 +53,7 @@ parse_tcp_ports(const char *portstring, u_int16_t *ports) ports[1] = cp[0] ? xtables_parse_port(cp, "tcp") : 0xFFFF; if (ports[0] > ports[1]) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "invalid portrange (min > max)"); } free(buffer); @@ -95,7 +95,7 @@ parse_tcp_flag(const char *flags) } } if (i == sizeof(tcp_flag_names)/sizeof(struct tcp_flag_names)) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unknown TCP flag `%s'", ptr); } @@ -122,7 +122,7 @@ parse_tcp_option(const char *option, u_int8_t *result) unsigned int ret; if (!xtables_strtoui(option, NULL, &ret, 1, UINT8_MAX)) - exit_error(PARAMETER_PROBLEM, "Bad TCP option `%s'", option); + xtables_error(PARAMETER_PROBLEM, "Bad TCP option \"%s\"", option); *result = ret; } @@ -148,7 +148,7 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags & TCP_SRC_PORTS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--source-port' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_tcp_ports(argv[optind-1], tcpinfo->spts); @@ -159,7 +159,7 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags, case '2': if (*flags & TCP_DST_PORTS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--destination-port' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_tcp_ports(argv[optind-1], tcpinfo->dpts); @@ -170,7 +170,7 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags, case '3': if (*flags & TCP_FLAGS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one of `--syn' or `--tcp-flags' " " allowed"); parse_tcp_flags(tcpinfo, "SYN,RST,ACK,FIN", "SYN", invert); @@ -179,14 +179,14 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags, case '4': if (*flags & TCP_FLAGS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one of `--syn' or `--tcp-flags' " " allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); if (!argv[optind] || argv[optind][0] == '-' || argv[optind][0] == '!') - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "--tcp-flags requires two args."); parse_tcp_flags(tcpinfo, argv[optind-1], argv[optind], @@ -197,7 +197,7 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags, case '5': if (*flags & TCP_OPTION) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--tcp-option' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_tcp_option(argv[optind-1], &tcpinfo->option); diff --git a/extensions/libxt_tcpmss.c b/extensions/libxt_tcpmss.c index 5c013a77..43a4a0d8 100644 --- a/extensions/libxt_tcpmss.c +++ b/extensions/libxt_tcpmss.c @@ -29,7 +29,7 @@ parse_tcp_mssvalue(const char *mssvalue) if (!xtables_strtoui(mssvalue, NULL, &mssvaluenum, 0, UINT16_MAX)) return mssvaluenum; - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Invalid mss `%s' specified", mssvalue); } @@ -63,7 +63,7 @@ tcpmss_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--mss' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_tcp_mssvalues(argv[optind-1], @@ -81,7 +81,7 @@ tcpmss_parse(int c, char **argv, int invert, unsigned int *flags, static void tcpmss_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "tcpmss match: You must specify `--mss'"); } diff --git a/extensions/libxt_time.c b/extensions/libxt_time.c index 41aa5c77..eb8b671b 100644 --- a/extensions/libxt_time.c +++ b/extensions/libxt_time.c @@ -142,10 +142,10 @@ static time_t time_parse_date(const char *s, bool end) if (ret >= 0) return ret; perror("mktime"); - exit_error(OTHER_PROBLEM, "mktime returned an error"); + xtables_error(OTHER_PROBLEM, "mktime returned an error"); out: - exit_error(PARAMETER_PROBLEM, "Invalid date \"%s\" specified. Should " + xtables_error(PARAMETER_PROBLEM, "Invalid date \"%s\" specified. Should " "be YYYY[-MM[-DD[Thh[:mm[:ss]]]]]", os); return -1; } @@ -175,7 +175,7 @@ static unsigned int time_parse_minutes(const char *s) return 60 * 60 * hour + 60 * minute + second; out: - exit_error(PARAMETER_PROBLEM, "invalid time \"%s\" specified, " + xtables_error(PARAMETER_PROBLEM, "invalid time \"%s\" specified, " "should be hh:mm[:ss] format and within the boundaries", s); return -1; } @@ -207,7 +207,7 @@ static uint32_t time_parse_monthdays(const char *arg) while (my_strseg(day, sizeof(day), &arg, ',') != NULL) { i = strtoul(day, &err, 0); if ((*err != ',' && *err != '\0') || i > 31) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "%s is not a valid day for --monthdays", day); ret |= 1 << i; } @@ -225,7 +225,7 @@ static unsigned int time_parse_weekdays(const char *arg) i = strtoul(day, &err, 0); if (*err == '\0') { if (i == 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "No, the week does NOT begin with Sunday."); ret |= 1 << i; continue; @@ -239,7 +239,7 @@ static unsigned int time_parse_weekdays(const char *arg) } if (!valid) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "%s is not a valid day specifier", day); } @@ -254,54 +254,54 @@ static int time_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case 'D': /* --datestart */ if (*flags & F_DATE_START) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Cannot specify --datestart twice"); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected \"!\" with --datestart"); info->date_start = time_parse_date(optarg, false); *flags |= F_DATE_START; return 1; case 'E': /* --datestop */ if (*flags & F_DATE_STOP) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Cannot specify --datestop more than once"); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "unexpected \"!\" with --datestop"); info->date_stop = time_parse_date(optarg, true); *flags |= F_DATE_STOP; return 1; case 'X': /* --timestart */ if (*flags & F_TIME_START) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Cannot specify --timestart more than once"); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected \"!\" with --timestart"); info->daytime_start = time_parse_minutes(optarg); *flags |= F_TIME_START; return 1; case 'Y': /* --timestop */ if (*flags & F_TIME_STOP) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Cannot specify --timestop more than once"); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected \"!\" with --timestop"); info->daytime_stop = time_parse_minutes(optarg); *flags |= F_TIME_STOP; return 1; case 'l': /* --localtz */ if (*flags & F_TIMEZONE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can only specify exactly one of --localtz or --utc"); info->flags |= XT_TIME_LOCAL_TZ; *flags |= F_TIMEZONE; return 1; case 'm': /* --monthdays */ if (*flags & F_MONTHDAYS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Cannot specify --monthdays more than once"); info->monthdays_match = time_parse_monthdays(optarg); if (invert) @@ -310,7 +310,7 @@ static int time_parse(int c, char **argv, int invert, unsigned int *flags, return 1; case 'w': /* --weekdays */ if (*flags & F_WEEKDAYS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Cannot specify --weekdays more than once"); info->weekdays_match = time_parse_weekdays(optarg); if (invert) @@ -319,7 +319,7 @@ static int time_parse(int c, char **argv, int invert, unsigned int *flags, return 1; case 'u': /* --utc */ if (*flags & F_TIMEZONE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can only specify exactly one of --localtz or --utc"); info->flags &= ~XT_TIME_LOCAL_TZ; *flags |= F_TIMEZONE; diff --git a/extensions/libxt_tos.c b/extensions/libxt_tos.c index a6118400..b810ea6d 100644 --- a/extensions/libxt_tos.c +++ b/extensions/libxt_tos.c @@ -54,7 +54,7 @@ static int tos_mt_parse_v0(int c, char **argv, int invert, unsigned int *flags, if (!tos_parse_symbolic(optarg, &tvm, 0xFF)) xtables_param_act(XTF_BAD_VALUE, "tos", "--tos", optarg); if (tvm.mask != 0xFF) - exit_error(PARAMETER_PROBLEM, "tos: Your kernel is " + xtables_error(PARAMETER_PROBLEM, "tos: Your kernel is " "too old to support anything besides /0xFF " "as a mask."); info->tos = tvm.value; @@ -90,7 +90,7 @@ static int tos_mt_parse(int c, char **argv, int invert, unsigned int *flags, static void tos_mt_check(unsigned int flags) { if (flags == 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "tos: --tos parameter required"); } diff --git a/extensions/libxt_u32.c b/extensions/libxt_u32.c index f0bb61a3..c2aeb271 100644 --- a/extensions/libxt_u32.c +++ b/extensions/libxt_u32.c @@ -92,10 +92,10 @@ static u_int32_t parse_number(char **s, int pos) errno = 0; number = strtoul(*s, &end, 0); if (end == *s) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "u32: at char %d: expected number", pos); if (errno != 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "u32: at char %d: error reading number", pos); *s = end; return number; @@ -129,10 +129,10 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags, if (*arg == '\0') { /* end of argument found */ if (state == 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "u32: abrupt end of input after location specifier"); if (valind == 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "u32: test ended with no value specified"); ct->nnums = locind; @@ -140,7 +140,7 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags, data->ntests = ++testind; if (testind > XT_U32_MAXSIZE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "u32: at char %u: too many \"&&\"s", (unsigned int)(arg - start)); return 1; @@ -153,7 +153,7 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags, */ if (*arg == '=') { if (locind == 0) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "u32: at char %u: " "location spec missing", (unsigned int)(arg - start)); @@ -168,18 +168,18 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags, ct->location[locind].nextop = XT_U32_AND; } else if (*arg == '<') { if (*++arg != '<') - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "u32: at char %u: a second '<' was expected", (unsigned int)(arg - start)); ct->location[locind].nextop = XT_U32_LEFTSH; } else if (*arg == '>') { if (*++arg != '>') - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "u32: at char %u: a second '>' was expected", (unsigned int)(arg - start)); ct->location[locind].nextop = XT_U32_RIGHTSH; } else if (*arg == '@') { ct->location[locind].nextop = XT_U32_AT; } else { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "u32: at char %u: operator expected", (unsigned int)(arg - start)); } ++arg; @@ -188,7 +188,7 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags, ct->location[locind].number = parse_number(&arg, arg - start); if (++locind > XT_U32_MAXSIZE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "u32: at char %u: too many operators", (unsigned int)(arg - start)); } } else { @@ -199,17 +199,17 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags, */ if (*arg == '&') { if (*++arg != '&') - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "u32: at char %u: a second '&' was expected", (unsigned int)(arg - start)); if (valind == 0) { - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "u32: at char %u: value spec missing", (unsigned int)(arg - start)); } else { ct->nnums = locind; ct->nvalues = valind; ct = &data->tests[++testind]; if (testind > XT_U32_MAXSIZE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "u32: at char %u: too many \"&&\"s", (unsigned int)(arg - start)); ++arg; state = 0; @@ -219,7 +219,7 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags, } else { /* read value range */ if (valind > 0) { /* need , before number */ if (*arg != ',') - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "u32: at char %u: expected \",\" or \"&&\"", (unsigned int)(arg - start)); ++arg; } @@ -239,7 +239,7 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags, } if (++valind > XT_U32_MAXSIZE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "u32: at char %u: too many \",\"s", (unsigned int)(arg - start)); } } diff --git a/extensions/libxt_udp.c b/extensions/libxt_udp.c index 8f57f4ec..4b4e84fb 100644 --- a/extensions/libxt_udp.c +++ b/extensions/libxt_udp.c @@ -45,7 +45,7 @@ parse_udp_ports(const char *portstring, u_int16_t *ports) ports[1] = cp[0] ? xtables_parse_port(cp, "udp") : 0xFFFF; if (ports[0] > ports[1]) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "invalid portrange (min > max)"); } free(buffer); @@ -70,7 +70,7 @@ udp_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': if (*flags & UDP_SRC_PORTS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--source-port' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_udp_ports(argv[optind-1], udpinfo->spts); @@ -81,7 +81,7 @@ udp_parse(int c, char **argv, int invert, unsigned int *flags, case '2': if (*flags & UDP_DST_PORTS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Only one `--destination-port' allowed"); xtables_check_inverse(optarg, &invert, &optind, 0); parse_udp_ports(argv[optind-1], udpinfo->dpts); diff --git a/extensions/tos_values.c b/extensions/tos_values.c index 81f6de1c..2676d81e 100644 --- a/extensions/tos_values.c +++ b/extensions/tos_values.c @@ -42,13 +42,13 @@ static bool tos_parse_numeric(const char *str, struct tos_value_mask *tvm, const char *p = end + 1; if (!xtables_strtoui(p, &end, &value, 0, max)) - exit_error(PARAMETER_PROBLEM, "Illegal value: \"%s\"", + xtables_error(PARAMETER_PROBLEM, "Illegal value: \"%s\"", str); tvm->mask = value; } if (*end != '\0') - exit_error(PARAMETER_PROBLEM, "Illegal value: \"%s\"", str); + xtables_error(PARAMETER_PROBLEM, "Illegal value: \"%s\"", str); return true; } @@ -70,7 +70,7 @@ static bool tos_parse_symbolic(const char *str, struct tos_value_mask *tvm, return true; } - exit_error(PARAMETER_PROBLEM, "Symbolic name \"%s\" is unknown", str); + xtables_error(PARAMETER_PROBLEM, "Symbolic name \"%s\" is unknown", str); return false; } -- cgit v1.2.3