summaryrefslogtreecommitdiffstats
path: root/extensions/libip6t_rt.c
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/libip6t_rt.c')
-rw-r--r--extensions/libip6t_rt.c32
1 files changed, 16 insertions, 16 deletions
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 && i<IP6T_RT_HOPS; cp=next,i++)
{
@@ -124,7 +124,7 @@ parse_addresses(const char *addrstr, struct in6_addr *addrp)
printf("addr [%d]: %s\n", i, addr_to_numeric(&(addrp[i])));
#endif
}
- if (cp) exit_error(PARAMETER_PROBLEM, "too many addresses specified");
+ if (cp) xtables_error(PARAMETER_PROBLEM, "too many addresses specified");
free(buffer);
@@ -156,7 +156,7 @@ static int rt_parse(int c, char **argv, int invert, unsigned int *flags,
switch (c) {
case '1':
if (*flags & IP6T_RT_TYP)
- exit_error(PARAMETER_PROBLEM,
+ xtables_error(PARAMETER_PROBLEM,
"Only one `--rt-type' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0);
rtinfo->rt_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;