summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--iptables.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/iptables.c b/iptables.c
index 3ff0589..25e6d9f 100644
--- a/iptables.c
+++ b/iptables.c
@@ -689,10 +689,15 @@ find_proto(const char *pname, enum ipt_tryload tryload, int nolookup)
{
unsigned int proto;
- if (string_to_number(pname, 0, 255, &proto) != -1)
- return find_match(proto_to_name(proto, nolookup), tryload);
+ if (string_to_number(pname, 0, 255, &proto) != -1) {
+ char *protoname = proto_to_name(proto, nolookup);
- return find_match(pname, tryload);
+ if (protoname)
+ return find_match(protoname, tryload);
+ } else
+ return find_match(pname, tryload);
+
+ return NULL;
}
u_int16_t