user31712: I understand from this answer the semantics of addr_from and addr_recv. It is not clear to me though what is their purpose. Don't we assume that the transport layer protocol takes care of, well, transport?
What happens if I send a version message where the information addr_from or addr_recv is missing or incorrect? E.g., in this answer the example code includes the following:
addr_recv = struct.pack("Q", 0)
addr_recv += struct.pack(">16s", "127.0.0.1")
addr_recv += struct.pack(">H", 8333)
addr_from = struct.pack("Q", 0)
addr_from += struct.pack(">16s", "127.0.0.1")
addr_from += struct.pack(">H", 8333)

If that works, why include anything meaningful in those fields?

user31712: Answered in this comment:

Bitcoin Core actually ignores addr_from in received version
  messages. addr_recv is used to influence the heuristic that
  determines which of the receiving node's IP addresses is publicly
  reachable.


31712: <p>I understand from <a href="https://bitcoin.stackexchange.com/a/29876/31712">this answer</a> the semantics of <code>addr_from</code> and <code>addr_recv</code>. It is not clear to me though what is their purpose. Don't we assume that the transport layer protocol takes care of, well, transport?</p>

<p>What happens if I send a version message where the information <code>addr_from</code> or <code>addr_recv</code> is missing or incorrect? E.g., in <a href="https://bitcoin.stackexchange.com/a/50502/31712">this answer</a> the example code includes the following:</p>

<pre><code>addr_recv = struct.pack("Q", 0)
addr_recv += struct.pack("&gt;16s", "127.0.0.1")
addr_recv += struct.pack("&gt;H", 8333)
addr_from = struct.pack("Q", 0)
addr_from += struct.pack("&gt;16s", "127.0.0.1")
addr_from += struct.pack("&gt;H", 8333)
</code></pre>

<p>If that works, why include anything meaningful in those fields?</p>
 31712: <p>Answered in <a href="https://bitcoin.stackexchange.com/questions/29872/addr-recv-addr-from-in-version-message/29876#comment84453_29876">this comment</a>:</p>

<blockquote>
  <p>Bitcoin Core actually ignores <code>addr_from</code> in received version
  messages. <code>addr_recv</code> is used to influence the heuristic that
  determines which of the receiving node's IP addresses is publicly
  reachable.</p>
</blockquote>
