Closed
Conversation
This avoids code duplication and allows ICMP packets to be routed.
Now this probably needs some more work as there can be multiple local IP addresses, but currently the address that is compared agains the destination of incomming packets is rather arbitrary. Also an address is only considered foreign when it's first 112 bits match, but the last 8 bit don't match - if the incomming address is completely different from myaddr, it's still considered a local address as there is no other code path. I've left this as is to not break things, but I think this needs further discussion or better documentation.
…her packet types generate a DEBUG message
Member
|
+1 for the idea and no objections at a first glance. |
Member
|
#644 does something similar. |
Contributor
|
as discussed in dev meeting: duplicate of #644, won't merge, close |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.