Subject: Re: how to get FreeBSD ping.c into NetBSD?
To: Hubert Feyrer <email@example.com>
From: Gert Doering <firstname.lastname@example.org>
Date: 11/22/2006 20:20:07
On Wed, Nov 22, 2006 at 08:10:18PM +0100, Hubert Feyrer wrote:
> On Wed, 22 Nov 2006, David Young wrote:
> > -I ifaddr
> > Send multicast datagrams on the network interface specified by
> > the interface's hostname or IP address.
> How about:
> -I ipaddr
> Send datagrams on the network interface specified by the
> interface's hostname or IP address,
Hmmm, that's not actually what it's doing ("send out on *that* network
interface"). It's just using that IP address, and sending out the
packets via the normal routing table (unless "-r" is set).
Send datagrams using the specified source IP address. This option
can be used to force the source address to be [...]
> and use that as the source address of outgoing packets.
> On hosts with more than one IP
> address, this option can be used to force the source address to be
> something other than the IP address of the interface the probe
> packet is sent on. If the IP address is not one of this machine's
> interface addresses, an error is returned and nothing is sent.
> (taken mostly from FreeBSD; someone please confirm if the error handling
> is actually true!)
Yep, the error handling works:
email@example.com:/home/gert$ ping -I 18.104.22.168 22.214.171.124
64 bytes from 126.96.36.199: icmp_seq=0 ttl=61 time=1.553 ms
firstname.lastname@example.org:/home/gert$ ping -I 188.8.131.52 184.108.40.206
ping: Can't set source interface/address: Can't assign requested address
(220.127.116.11 is an alias on lo0, used for routing/IPSEC tests)
USENET is *not* the non-clickable part of WWW!
Gert Doering - Munich, Germany email@example.com
fax: +49-89-35655025 firstname.lastname@example.org