Merge tag 'upstream/1.40' into tizen.
[platform/upstream/connman.git] / src / iptables.c
index 2ee9485..90a296e 100755 (executable)
@@ -2947,7 +2947,7 @@ static int parse_ip_and_mask(const char *str, struct in_addr *ip,
        if (!tokens)
                return -1;
 
-       if (!inet_pton(AF_INET, tokens[0], ip)) {
+       if (inet_pton(AF_INET, tokens[0], ip) != 1) {
                err = -1;
                goto out;
        }
@@ -2988,7 +2988,7 @@ static int parse_ipv6_and_mask(const char *str, struct in6_addr *ip,
        if (!tokens)
                return -1;
 
-       if (!inet_pton(AF_INET6, tokens[0], ip)) {
+       if (inet_pton(AF_INET6, tokens[0], ip) != 1) {
                err = -1;
                goto out;
        }
@@ -3399,7 +3399,7 @@ static int parse_rule_spec(struct connman_iptables *table,
                                        break;
 
                                if (invert)
-                                       ctx->ip->invflags |= IP6T_INV_DSTIP;
+                                       ctx->ipv6->invflags |= IP6T_INV_DSTIP;
                        }
 
                        break;