ctdb: Fix CID 1347319 Unchecked return value
authorVolker Lendecke <vl@samba.org>
Thu, 7 Jan 2016 20:14:05 +0000 (21:14 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 8 Jan 2016 01:37:18 +0000 (02:37 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
ctdb/common/system_linux.c

index 6447f56062c6c9db1dde149aa29f034244aff378..55c22c52b6c9c91e96aadcf71122b1e8a80f1668 100644 (file)
@@ -247,7 +247,13 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface)
                ip6->ip6_hlim = 255;
                ip6->ip6_src  = addr->ip6.sin6_addr;
                /* all-nodes multicast */
-               inet_pton(AF_INET6, "ff02::1", &ip6->ip6_dst);
+
+               ret = inet_pton(AF_INET6, "ff02::1", &ip6->ip6_dst);
+               if (ret != 1) {
+                       close(s);
+                       DEBUG(DEBUG_CRIT,(__location__ " failed inet_pton\n"));
+                       return -1;
+               }
 
                nd_na = (struct nd_neighbor_advert *)(ip6+1);
                nd_na->nd_na_type = ND_NEIGHBOR_ADVERT;