summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 73b98f0)
raw | patch | inline | side by side (parent: 73b98f0)
author | Florian Forster <octo@verplant.org> | |
Thu, 1 Jun 2006 20:17:19 +0000 (22:17 +0200) | ||
committer | Florian Forster <octo@verplant.org> | |
Thu, 1 Jun 2006 20:17:19 +0000 (22:17 +0200) |
The call to bind, thoug working fine under GNU/Linux, seems not to work under
other operating systems. It didn't work under FreeBSD and Mac OS X with the
`bind' call but without.
I think `bind' may only be neccessary if we want to bind to a specific
interface. It might be a good idea to add the possibility later, so I only
commented the code for now.
other operating systems. It didn't work under FreeBSD and Mac OS X with the
`bind' call but without.
I think `bind' may only be neccessary if we want to bind to a specific
interface. It might be a good idea to add the possibility later, so I only
commented the code for now.
src/liboping.c | patch | blob | history |
diff --git a/src/liboping.c b/src/liboping.c
index 6dbb73f9a875e6b3b550c11d231fa340d0e36f79..debd432fd7f7793d7345858094c575aad0997c01 100644 (file)
--- a/src/liboping.c
+++ b/src/liboping.c
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));
ph->fd = -1;
continue;
}
+#endif
assert (sizeof (struct sockaddr_storage) >= ai_ptr->ai_addrlen);
memset (ph->addr, '\0', sizeof (struct sockaddr_storage));