Code

src/liboping.c: Check if IPPROTO_IPV6 and IPV6_RECVHOPLIMIT are defined.
authorFlorian Forster <octo@verplant.org>
Wed, 15 Jul 2009 09:33:33 +0000 (11:33 +0200)
committerFlorian Forster <octo@verplant.org>
Wed, 15 Jul 2009 09:33:33 +0000 (11:33 +0200)
src/liboping.c

index 88244bb7b66faed42967dfed725aea15c96e11b3..51071ada56a603164ca4a3a0e002cc6b79a4554a 100644 (file)
@@ -1352,6 +1352,7 @@ int ping_host_add (pingobj_t *obj, const char *host)
                        setsockopt (ph->fd, IPPROTO_IP, IP_RECVTTL,
                                        &opt, sizeof (opt));
                }
+#if defined(IPPROTO_IPV6) && defined(IPV6_RECVHOPLIMIT)
                else if (ph->addrfamily == AF_INET6)
                {
                        int opt = 1;
@@ -1359,6 +1360,7 @@ int ping_host_add (pingobj_t *obj, const char *host)
                        setsockopt (ph->fd, IPPROTO_IPV6, IPV6_RECVHOPLIMIT,
                                        &opt, sizeof (opt));
                }
+#endif
 
                break;
        }