diff options
Diffstat (limited to 'extensions/libipt_dccp.c')
-rw-r--r-- | extensions/libipt_dccp.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/extensions/libipt_dccp.c b/extensions/libipt_dccp.c index 603be1d..e5782a8 100644 --- a/extensions/libipt_dccp.c +++ b/extensions/libipt_dccp.c @@ -56,20 +56,6 @@ static struct option opts[] = { { .name = 0 } }; -static u_int16_t -parse_dccp_port(const char *port) -{ - unsigned int portnum; - - DEBUGP("%s\n", port); - if (string_to_number(port, 0, 65535, &portnum) != -1 || - (portnum = service_to_port(port, "dccp")) != -1) - return (u_int16_t)portnum; - - exit_error(PARAMETER_PROBLEM, - "invalid DCCP port/service `%s' specified", port); -} - static void parse_dccp_ports(const char *portstring, u_int16_t *ports) @@ -80,14 +66,14 @@ parse_dccp_ports(const char *portstring, buffer = strdup(portstring); DEBUGP("%s\n", portstring); if ((cp = strchr(buffer, ':')) == NULL) { - ports[0] = ports[1] = parse_dccp_port(buffer); + ports[0] = ports[1] = parse_port(buffer, "dccp"); } else { *cp = '\0'; cp++; - ports[0] = buffer[0] ? parse_dccp_port(buffer) : 0; - ports[1] = cp[0] ? parse_dccp_port(cp) : 0xFFFF; + ports[0] = buffer[0] ? parse_port(buffer, "dccp") : 0; + ports[1] = cp[0] ? parse_port(cp, "dccp") : 0xFFFF; if (ports[0] > ports[1]) exit_error(PARAMETER_PROBLEM, |