OR address is in host order in INTRODUCE2 cell
It seems that the IP address of the RP is in host order in INTRODUCE2 cells, when it should be in network order. Here is the bad code https://gitweb.torproject.org/tor.git/blob/f8f0cb0443c0709454c9223f25266ec1b0c464b8:/src/or/rendclient.c#l274 :
set_uint32(tmp+v3_shift+1, tor_addr_to_ipv4h(&extend_info->addr));
and here is the code that tries to parse it https://gitweb.torproject.org/tor.git/blob/f8f0cb0443c0709454c9223f25266ec1b0c464b8:/src/or/rendservice.c#l1785 :
tor_addr_from_ipv4n(&extend_info->addr, get_uint32(buf + 1));
Roger found that the bug was introduced in 960a0f0a
.
That said, rendezvous seems to work IRL so this bug is not so severe. Rendezvous is completed properly, because the HS probably uses the identity digest to map to a node.
I encountered that bug while fiddling with #12844 (moved) and trying to use a relay I just made as my RP. It didn't work.