opportunistic service registration fails

Bug #1088916 reported by Miika Komu
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
HIPL
Fix Committed
Undecided
Jookos

Bug Description

Opportunistic registration to e.g. RVS fails. From Joakim from the mailing list:

A short overview, just tell me if you need more info:

I have 1 RVS server and 2 clients. On the server I use the default hipl config, doing only a 'hipconf daemon add service rvs'.
Client 1 tries to register to the RVS, and client 2 ping client 1. No firewalls on the hosts (iptables accepts all). One of the client is behind a nat, the other (as well as the RVS) has a public ip. Doesn't matter which one registers, and which tries to ping, both cases produce the same errors.

When client 1 register, the RVS server produces a bunch of these:

error(libcore/builder.c:1975@hip_verify_network_header): Invalid version in received packet. Dropping
error(libcore/message.c:677@read_control_msg_all): verifying network header failed
error(libhipl/hip_socket.c:137@handle_nat_input): Reading network msg failed

But after a while, or more often after trying it again (doing another 'hipconf daemon add server rvs <ip> <time>'), it apparently gets through, logging on the RVS:
error(libcore/hostsfiles.c:432@hip_map_hit_to_lsi_from_hosts_fi: Failed to map id to hostname
info(libhipl/input.c:1775@hip_handle_i2): Reached ESTABLISHED state
error(modules/cert/hipd/cert.c:68@hip_add_certificate): Certificate is NULL

After that there's a lot of:
info(libhipl/input.c:534@hip_receive_control_packet): Src IP: <rvs client ip>
info(libhipl/input.c:535@hip_receive_control_packet): Dst IP: <rvs serve ip>

on the RVS server, as the client apparently has problems receiving the packets the server is sending, printing:
info(libhipl/input.c:534@hip_receive_control_packet): Src IP: <rvs server ip>
info(libhipl/input.c:535@hip_receive_control_packet): Dst IP: <rvs client ip>
error(libhipl/input.c:658@hip_receive_udp_control_packet): receiving of control packet failed

There seems to be some sort of retransmission-limit, as eventually it just dies out.. stops trying.

Then, on the second client, we try to ping the first one through the RVS:

'hipconf daemon add map <client 1 hit> <rvs server ip>':
error(libcore/gpl/nlink.c:879@parse_rtattr): Deficit len 28, rta_len=0
error(libcore/hostsfiles.c:123@for_each_hosts_file_line): Failed to open hosts file
error(libcore/hostsfiles.c:432@hip_map_hit_to_lsi_from_hosts_fi: Failed to map id to hostname

..which doesn't look good. But ignoring that, we try 'ping6 <client 1 hit>'.

The RVS server does, apparently, receive something, because the log starts getting full of:
error(libhipl/input.c:658@hip_receive_udp_control_packet): receiving of control packet failed

but nothing else, and this doesn't change. However, using another host as RVS may get you:
info(libhipl/input.c:534@hip_receive_control_packet): Src IP: <client 2 ip>
info(libhipl/input.c:535@hip_receive_control_packet): Dst IP: <rvs ip>
info(libhipl/input.c:1218@hip_check_i1): Matching relay record found.
error(libcore/gpl/nlink.c:879@parse_rtattr): Deficit len 28, rta_len=0
error(libhipl/pkt_handling.c:170@hip_run_handle_functions): Error after running registered handle function, dropping packet...

.. which seems ok. But on client 1 (the one registered to the rvs), there's just a lot of:
info(libhipl/input.c:534@hip_receive_control_packet): Src IP: <rvs ip>
info(libhipl/input.c:535@hip_receive_control_packet): Dst IP: <client 1 ip>

And nothing else happens. Does this sould familiar to anyone? Does anyone else have a problem with this or could it be something in the environment I'm using (a mix of debian stable/unstable/testing)?

Related branches

Revision history for this message
Jookos (jookos) wrote :

Did a quick trace and the problem apparently is that during opportunistic bexes, when receiving the R1 a new hadb entry is created with the proper HITs, and the old one removed. While creating this new entry, the hip_version is never set. This results in a faulty I2.

Attached is a simple patch which wfm.

Revision history for this message
Jookos (jookos) wrote :

Here's the patch

Revision history for this message
Miika Komu (miika-iki) wrote :

Thanks for the patch, I tested it and seemed work just fine.

Changed in hipl:
assignee: Miika Komu (miika-iki) → Jookos (jookos)
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.