Make ICMP echo requests routable #670
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes
icmpv6_send_echo_requestandicmpv6_send_echo_replyuseipv6_sendtoinstead of duplicating the code, which allows them to use the routing capabilities ofipv6_sendto.To make routing actually work,
ipv6_sendtohas to determine whether a packet is addressed to the local node or a foreign router. For this it currently uses the hard-coded local addresswhich is not exported anywhere.
Instead a second patch changes this to the output of
ipv6_iface_get_best_src_addrfor 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.