summaryrefslogtreecommitdiffstats
path: root/lib/parse.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2011-10-28 18:16:13 +0200
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2011-11-16 22:47:33 +0100
commit20125f0086b5fddcef9f909e6e4aab475552eaba (patch)
treec06a67a8b91ca42bc36c32a353ecb9f61c652e5a /lib/parse.c
parent520e3d923a5689e3c0a3702406971a6f89726199 (diff)
ipset: fix lookup of tcp port names
The protocol argument to getservbyname() must be lowercase tcp not uppercase TCP. This fixes the bug observed by: # ipset add foo http ipset v6.9.1: Syntax error: 'http' is invalid as number Syntax error: cannot parse 'http' as a TCP port Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Diffstat (limited to 'lib/parse.c')
-rw-r--r--lib/parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/parse.c b/lib/parse.c
index 241d5ae..3ca702c 100644
--- a/lib/parse.c
+++ b/lib/parse.c
@@ -307,7 +307,7 @@ int
ipset_parse_tcp_port(struct ipset_session *session,
enum ipset_opt opt, const char *str)
{
- return ipset_parse_tcpudp_port(session, opt, str, "TCP");
+ return ipset_parse_tcpudp_port(session, opt, str, "tcp");
}
/**
@@ -330,7 +330,7 @@ ipset_parse_single_tcp_port(struct ipset_session *session,
assert(opt == IPSET_OPT_PORT || opt == IPSET_OPT_PORT_TO);
assert(str);
- return ipset_parse_port(session, opt, str, "TCP");
+ return ipset_parse_port(session, opt, str, "tcp");
}
/**