Code

Merge branch 'v022/net-unreach'
authorFlorian Forster <octo@verplant.org>
Sun, 16 Jul 2006 10:29:35 +0000 (12:29 +0200)
committerFlorian Forster <octo@verplant.org>
Sun, 16 Jul 2006 10:29:35 +0000 (12:29 +0200)
ChangeLog
src/liboping.c

index c4e1e3276b2000152b5fd91435015f97333ef3a7..80154f39d7e8b8e59a8e9ede3e129fd344a80c93 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        * The ability to set the source address from which the packets
          originate has been added to the library and the oping application.
 
+2006-07-16, Version 0.2.3
+       * `sendto(2)' now catches `EHOSTUNREACH' and `ENETUNREACH' if they're
+         defined.
+
 2006-06-05, Version 0.2.2
        * The `oping' application didn't exit if no hosts could be resolved.
          This release fixes it's behavior.
index 0dc956ea06310d337ead1168d96581c152216c3f..c42b50f74bc06df6573662b93579a46199cc7e04 100644 (file)
@@ -540,7 +540,17 @@ static ssize_t ping_sendto (pingobj_t *obj, pinghost_t *ph,
                        (struct sockaddr *) ph->addr, ph->addrlen);
 
        if (ret < 0)
+       {
+#if defined(EHOSTUNREACH)
+               if (errno == EHOSTUNREACH)
+                       return (0);
+#endif
+#if defined(ENETUNREACH)
+               if (errno == ENETUNREACH)
+                       return (0);
+#endif
                ping_set_error (obj, "sendto", strerror (errno));
+       }
 
        return (ret);
 }