#653476 ping6 -I option needs better documentation

Package:
iputils-ping
Source:
iputils
Description:
Tools to test the reachability of network hosts
Submitter:
Bruce Robson
Date:
2011-12-28 22:27:10 UTC
Severity:
minor
#653476#5
Date:
2011-12-28 18:06:15 UTC
From:
To:
Dear Maintainer,

I only have link local IPv6 addresses on my network and have been trying
to communicate between computers using IPv6 addresses.

ifconfig shows the following for wlan0
wlan0     Link encap:Ethernet  HWaddr 00:18:4d:b1:f4:98
          inet addr:192.168.1.67  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::218:4dff:feb1:f498/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2707 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1356 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1228869 (1.1 MiB)  TX bytes:156171 (152.5 KiB)

ping6 fe80::218:4dff:feb1:f498 fails with the message
    connect: Invalid argument

This is expected as the manual page states
    -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.

When I use -I with the device name wlan0 the ping succeeds
ping6 -I wlan0 fe80::218:4dff:feb1:f498
PING fe80::218:4dff:feb1:f498(fe80::218:4dff:feb1:f498) from fe80::218:4dff:feb1:f498 wlan0: 56 data bytes
64 bytes from fe80::218:4dff:feb1:f498: icmp_seq=1 ttl=64 time=0.218 ms
64 bytes from fe80::218:4dff:feb1:f498: icmp_seq=2 ttl=64 time=0.199 ms
^C
--- fe80::218:4dff:feb1:f498 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.199/0.208/0.218/0.017 ms

When I use -I with the numeric IP address it is supposed to succeed but fails
ping6 -I fe80::218:4dff:feb1:f498 fe80::218:4dff:feb1:f498
ping: bind icmp socket: Invalid argument

I get the same results when I ping to fe80::2c0:4fff:fe9c:8daf (the IPv6
of my other computer) i.e. no -I fails, -I wlan0 succeeds, -I numeric fails.


p.s. The command ssh -b fe80::218:4dff:feb1:f498 fe80::2c0:4fff:fe9c:8daf
     also fails when binding the numeric IP address
         bind: fe80::218:4dff:feb1:f498: Invalid argument

#653476#10
Date:
2011-12-28 18:43:32 UTC
From:
To:
The docs are a bit unclear.  You still need to provide the interface,
even when you provide the source address.  Do so by appending %<ifname>
to your local address, e.g.

ping6 -I fe80::218:4dff:feb1:f498%wlan0 fe80::218:4dff:feb1:f498

I'll take this bug as a request to update the docs.

noah