diff options
author | Jozsef Kadlecsik <kadlec@netfilter.org> | 2021-07-27 12:16:47 +0200 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@netfilter.org> | 2021-07-27 12:16:47 +0200 |
commit | a60c396063cf0868d5bad54b4e40b26b687d21a0 (patch) | |
tree | 65d00e3b444a454669f3c9ce885ff02b42a75d15 /lib | |
parent | 79184e760edfbc81bad313386f0918ed3568df1f (diff) |
When parsing protocols by number, do not check it in /etc/protocols.
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/parse.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/parse.c b/lib/parse.c index aabf2a8..974eaf8 100644 --- a/lib/parse.c +++ b/lib/parse.c @@ -493,13 +493,13 @@ ipset_parse_proto(struct ipset_session *session, assert(str); if (string_to_u8(session, str, &protonum, IPSET_WARNING) == 0) - protoent = getprotobynumber(protonum); - else { - /* No error, so reset false error messages */ - ipset_session_report_reset(session); - protoent = getprotobyname(strcasecmp(str, "icmpv6") == 0 - ? "ipv6-icmp" : str); - } + return ipset_session_data_set(session, opt, &protonum); + + /* No error, so reset false error messages */ + ipset_session_report_reset(session); + protoent = getprotobyname(strcasecmp(str, "icmpv6") == 0 + ? "ipv6-icmp" : str); + if (protoent == NULL) return syntax_err("cannot parse '%s' " "as a protocol", str); |