]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
ss: Skip useless check in parse_hostcond()
authorPhil Sutter <phil@nwl.cc>
Thu, 17 Aug 2017 17:09:29 +0000 (19:09 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 22 Aug 2017 00:12:21 +0000 (17:12 -0700)
The passed 'addr' parameter is dereferenced by caller before and in
parse_hostcond() multiple times before this check, so assume it is
always true.

Signed-off-by: Phil Sutter <phil@nwl.cc>
misc/ss.c

index 10360e5a04ff89dd4fa88a0d0ad4738d30d19fa7..419076b2d52f892391d2f193dab5139fc6961e3a 100644 (file)
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -1671,7 +1671,7 @@ void *parse_hostcond(char *addr, bool is_port)
                        }
                }
        }
-       if (!is_port && addr && *addr && *addr != '*') {
+       if (!is_port && *addr && *addr != '*') {
                if (get_prefix_1(&a.addr, addr, fam)) {
                        if (get_dns_host(&a, addr, fam)) {
                                fprintf(stderr, "Error: an inet prefix is expected rather than \"%s\".\n", addr);