net: arp: Fix ARP retransmission source address selection #40038
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.
There was a problem with source address selection for ARP
retransmissions, when an ARP entry was already pending. In such case,
the
entry
value passed toarp_prepare()
is NULL, which in resultcaused the
current_ip
variable being used as the source value. Theproblem with this approach is, that the
current_ip
is only set inIPv4 autoconf, the Ethernet L2 does not set this variable. In result,
every retransmission of an ARP packet was sent with unspecified source
address, preventing the response from being handled.
Fix this by partially restoring the behaviour of the ARP source address
assignment from before IPv4 autoconf was introduced. If the ARP is sent
by the IPv4 autoconf, use the
current_ip
value provided. If entry isnot set, use the source IPv4 address set in the actual data packet.
Otherwise, search for a source address on the interface corresponding to
the
entry
.Signed-off-by: Robert Lubos robert.lubos@nordicsemi.no