]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
add bugfix in case we are using a protocol number (-p N) which has no matching /etc...
authorHarald Welte <laforge@gnumonks.org>
Mon, 18 Feb 2002 16:15:31 +0000 (16:15 +0000)
committerHarald Welte <laforge@gnumonks.org>
Mon, 18 Feb 2002 16:15:31 +0000 (16:15 +0000)
iptables.c

index 3ff05898b7245d9b00829077ba7933dd598bafb0..25e6d9f910a51271e59a850a19facc9f1cb426d9 100644 (file)
@@ -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