Coming from the only caller `host()', the `mask' parameter is -1 iff
`*s' does not contain "/".

Let's not discard that information and avoid the redundant search; this
makes the `mask' parameter actually being used.

OK?

Index: pfctl_parser.c
===================================================================
RCS file: /cvs/src/sbin/pfctl/pfctl_parser.c,v
retrieving revision 1.321
diff -u -p -r1.321 pfctl_parser.c
--- pfctl_parser.c      10 Jul 2018 09:30:49 -0000      1.321
+++ pfctl_parser.c      22 Jul 2018 10:47:47 -0000
@@ -1750,7 +1750,7 @@ host_v4(const char *s, int mask)
        int                      bits = 32;
 
        memset(&ina, 0, sizeof(struct in_addr));
-       if (strrchr(s, '/') != NULL) {
+       if (mask > -1) {
                if ((bits = inet_net_pton(AF_INET, s, &ina, sizeof(ina))) == -1)
                        return (NULL);
        } else {

Reply via email to