From: Jarek Poplawski <jarkao2@gmail.com>
To: CentOS mailing list
<public-centos-IFYaIzF+flcdnm+yROfE0A@plane.gmane.org>
Cc: public-netdev-u79uwXL29TY76Z2rM5mHXA@plane.gmane.org,
Omaha Linux User Group <public-olug-u8lKhlSLHjY@plane.gmane.org>
Subject: Re: Ping Is Broken
Date: Mon, 12 Oct 2009 09:47:52 +0000 [thread overview]
Message-ID: <20091012094752.GA8114@ff.dom.local> (raw)
In-Reply-To: <7e84ed60910090944q5c66ea0w63ed55a72482bf2f@mail.gmail.com>
On 09-10-2009 18:44, Rob Townley wrote:
> ping -I is broken
>
> The following deals with bug in ping that made it very difficult to set up a
> system with two gateways.
>
> Demonstration that *ping -I is broken*. When specifying the source
> interface using -I with an *ethX* alias and that interface is not the
> default gateway
> interface, then ping fails. When specifying the interface as an ip address,
> ping works. Search for "Destination Host Unreachable" to find the bug.
>
>
> eth*0* = 4.3.2.8 and the default gateway is accessed through a different
> interface eth*1*.
> eth*1* = 192.168.168.155 is used as the device to get to the default
> gateway.
> *FAILS *: ping *-I eth0* 208.67.222.222
> *WORKS*: ping *-I 4.3.2.8* 208.67.222.222
> *WORKS*: ping *-I eth1* 208.67.222.222
> *WORKS*: ping *-I 192.168.168.155* 208.67.222.222
...
> man ping:
> -I interface address
> Set source address to specified interface address.
> Argument may be *numeric IP address or name of device*.
> When pinging IPv6 link-local address this option is required.
It seems this description might be misleading that IP address and name
of device are equivalent here, while they are treated a bit different.
The device name is additionally used in a sendmsg message, probably to
guarantee the device is really used (not its address only), so it
looks like intended.
> ping -V returns the latest available on CentOS and Fedora and the
> maintainers website:
> ping utility, iputils-ss020927
I guess the patch below could do what you expect in this case, but
rather "man" should be fixed...
Jarek P.
---
--- ping.c.orig 2002-09-20 15:08:11.000000000 +0000
+++ ping.c 2009-10-12 08:51:25.000000000 +0000
@@ -323,7 +323,7 @@ main(int argc, char **argv)
perror("ping: icmp open socket");
exit(2);
}
-
+#if 0
if (device) {
struct ifreq ifr;
@@ -336,7 +336,7 @@ main(int argc, char **argv)
cmsg.ipi.ipi_ifindex = ifr.ifr_ifindex;
cmsg_len = sizeof(cmsg);
}
-
+#endif
if (broadcast_pings || IN_MULTICAST(ntohl(whereto.sin_addr.s_addr))) {
if (uid) {
if (interval < 1000) {
next prev parent reply other threads:[~2009-10-12 9:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-09 10:16 Ping Is Broken Rob Townley
[not found] ` <7e84ed60910090316ne9224fat81d9c79c58fc713b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-10-09 16:34 ` Rob Townley
[not found] ` <7e84ed60910090934y2a0d422cr158aa8d15e452f97-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-10-09 16:44 ` Rob Townley
2009-10-12 9:47 ` Jarek Poplawski [this message]
2009-10-12 19:14 ` Rob Townley
2009-10-12 20:43 ` Jarek Poplawski
2009-10-12 20:36 ` Brian Haley
2009-10-12 21:28 ` Jarek Poplawski
2009-10-12 21:45 ` Jarek Poplawski
2009-10-12 23:30 ` Brian Haley
2009-10-13 5:10 ` Jarek Poplawski
2009-10-13 13:48 ` Brian Haley
[not found] ` <006a01ca4a10$a1a4ba60$e4ee2f20$@com>
[not found] ` <7e84ed60910111032s2f03b6dew5c756895872e1a0c@mail.gmail.com>
[not found] ` <000301ca4b13$60a26e00$21e74a00$@com>
[not found] ` <7e84ed60910121115i30ec3512uce46cf0ff3b3954c@mail.gmail.com>
[not found] ` <Pine.LNX.4.64.0910121934360.26068@pakmon.pakint.net>
2009-11-22 20:10 ` [olug] " Rob Townley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091012094752.GA8114@ff.dom.local \
--to=jarkao2@gmail.com \
--cc=public-centos-IFYaIzF+flcdnm+yROfE0A@plane.gmane.org \
--cc=public-netdev-u79uwXL29TY76Z2rM5mHXA@plane.gmane.org \
--cc=public-olug-u8lKhlSLHjY@plane.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).