summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_multiport.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2011-05-09 20:23:21 +0200
committerPatrick McHardy <kaber@trash.net>2011-05-09 20:23:21 +0200
commitc29f7ef7cb5a31620060ef721d3c65b343eb537a (patch)
tree09d7a610fbdda5c259d85458f4b6cf9ae9b07f03 /extensions/libxt_multiport.c
parentedc2b1adf32d2b11e126174f525293b3bca6e7bc (diff)
parent6cfb28bb9032dcf2749ff80f88ad37b9fe5e7c2a (diff)
Merge branch 'opts' of git://dev.medozas.de/iptables
Diffstat (limited to 'extensions/libxt_multiport.c')
-rw-r--r--extensions/libxt_multiport.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/extensions/libxt_multiport.c b/extensions/libxt_multiport.c
index 163c7dc5..7fa537e0 100644
--- a/extensions/libxt_multiport.c
+++ b/extensions/libxt_multiport.c
@@ -53,7 +53,7 @@ static const struct option multiport_opts[] = {
XT_GETOPT_TABLEEND,
};
-static char *
+static const char *
proto_to_name(uint8_t proto)
{
switch (proto) {
@@ -135,7 +135,7 @@ parse_multi_ports_v1(const char *portstring,
static const char *
check_proto(uint16_t pnum, uint8_t invflags)
{
- char *proto;
+ const char *proto;
if (invflags & XT_INV_PROTO)
xtables_error(PARAMETER_PROBLEM,
@@ -285,10 +285,10 @@ static void multiport_check(unsigned int flags)
xtables_error(PARAMETER_PROBLEM, "multiport expection an option");
}
-static char *
+static const char *
port_to_service(int port, uint8_t proto)
{
- struct servent *service;
+ const struct servent *service;
if ((service = getservbyport(htons(port), proto_to_name(proto))))
return service->s_name;
@@ -299,7 +299,7 @@ port_to_service(int port, uint8_t proto)
static void
print_port(uint16_t port, uint8_t protocol, int numeric)
{
- char *service;
+ const char *service;
if (numeric || (service = port_to_service(port, protocol)) == NULL)
printf("%u", port);