main: fix the check on inet_pton return value because it returns 1 on success.
authorSaverio Proto <zioproto@gmail.com>
Fri, 22 Feb 2013 11:03:10 +0000 (12:03 +0100)
committerSaverio Proto <zioproto@gmail.com>
Fri, 22 Feb 2013 11:20:45 +0000 (12:20 +0100)
This bug was introduced in commit b3f05653fc085193504218e47458891acf7c495d and it was preventing olsrd from working in IPv6 mode.

src/linux/net.c

index 7707303..650773f 100644 (file)
@@ -637,7 +637,7 @@ get_ipv6_address(char *ifname, struct sockaddr_in6 *saddr6, struct olsr_ip_prefi
         OLSR_PRINTF(5, "\tinet6 addr: %s\n", addr6);
         OLSR_PRINTF(5, "\tScope: %d\n", scope);
 
-        if (inet_pton(AF_INET6, addr6, &tmp_ip.v6)) {
+        if (inet_pton(AF_INET6, addr6, &tmp_ip.v6) != 1) {
           continue;
         }