RIOT-OS/RIOT — pull request #670 by benpicco (2014-02-10 03:46:20+00:00)
Title: Make ICMP echo requests routable

This makes `icmpv6_send_echo_request` and `icmpv6_send_echo_reply` use `ipv6_sendto` instead of duplicating the code, this allows them to use the routing capabilities of `ipv6_sendto`.

To make routing actually work, `ipv6_sendto` has to determine whether a packet is addressed to the local node or a foreign router. For this it uses the hard-coded local address

abcd:0:0:0:3612:ff:fe00:sixlowpan_mac_get_radio_address()

which is not exported anywhere.
Instead a second patch changes this to the output of `ipv6_iface_get_best_src_addr` for when addressing all nodes. This should probably consider all possible local addresses instead, which could be done in a later patch.

Another odd thing to note about this code is that an address is considered 'foreign' according to the comments if the first 112 bits match but the last 8 bits differ. Even if the address is completely different from the local address, it's considered local as there is no other code path.
This was left unchanged as it would probably introduce breakage in existing applications.