X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fliboping.c;h=debd432fd7f7793d7345858094c575aad0997c01;hb=78164c719fbd60c9c7db7bd11477fde6efe5edba;hp=c6e9df5fce61dff99a7909c078048a2ea9ab4c34;hpb=2ca8aa4e5dc4aad08bae3c007cbdc39d0d30ea1f;p=liboping.git diff --git a/src/liboping.c b/src/liboping.c index c6e9df5..debd432 100644 --- a/src/liboping.c +++ b/src/liboping.c @@ -370,7 +370,7 @@ static int ping_receive_one (int fd, pinghost_t *ph, struct timeval *now) return (-1); } - dprintf ("Read %i bytes from fd = %i\n", buffer_len, fd); + dprintf ("Read %u bytes from fd = %i\n", (unsigned int) buffer_len, fd); if (sa.ss_family == AF_INET) { @@ -1021,6 +1021,12 @@ int ping_host_add (pingobj_t *obj, const char *host) continue; } +/* + * The majority vote of operating systems has decided that you don't need to + * bind here. This code should be reactivated to bind to a specific address, + * though. See the `-I' option of `ping(1)' (GNU). -octo + */ +#if 0 if (bind (ph->fd, (struct sockaddr *) &sockaddr, sockaddr_len) == -1) { dprintf ("bind: %s\n", strerror (errno)); @@ -1029,6 +1035,7 @@ int ping_host_add (pingobj_t *obj, const char *host) ph->fd = -1; continue; } +#endif assert (sizeof (struct sockaddr_storage) >= ai_ptr->ai_addrlen); memset (ph->addr, '\0', sizeof (struct sockaddr_storage));