As reported on users mailing list:
Hi!
I had the following configuration:
Initiator (3ffe::1/64) ------ (3ffe::2/64) RVS (3ffe:1::2/64) ------- (3ffe:1::1/64) Responder
Network configuration is OK, 'cause I can ping everyone from everywhere (IPv6 forwarding is enabled+routes are created).
I started the RVS with: hip -v -m -g 1, because I had a registered_host_identities file containing the registration of Responder (HIT <--> IP). Then I want to ping the LSI of Responder from the Initiator and I get the following error at RVS:
"Found existing registration entry(0) with HIT: ... and IP address: ...
*** state not found for RVS HMAC
Relaying HIP_I1 packet..."
After this the RVS crashed. What can be the problem? What are missing?
suggested workaround:
When I worked on HIP I had the same problem. Here are what I have
understood and done.
When the RVS receives the I1 packet from the Initiator it tries to
registered the Initiator in its registration entries but it fails
because the Initiator is already registered in its registration
entries (thanks to the configuration file you filled in). So the first
message: " Found existing ... " is logical and normal.
Then the RVS tries to relay the I1 packet, what is normal...
At about the same time there is a memcpy() (or something like that, I
don't remember exactly) which role is to register the Initiator in the
registration entries of the RVS wich fail (and involve a segmentation
fault), may be because the Initiator is already registered but I am
not sure of this point.
The fact is I "solve" the problem deleting this step. Indeed, the
registration of the source of an I1 packet which a RVS has to relay is
not required by the specification of the protocol, and it works very
well even if you delete this step.
Hi,
Here is an other reason of RVS crashes in IPv6 context:
When the RVS relays an I1 packet it should add in the I1 relayed packet the parameter FROM which contains the source locator (that is the IP address of the HBE Initiator). The parameter allows the Responder to reply directly to the Initiator without any third party. The problem is that this parameter is not correctly filled in IPv6 context. Indeed the IPv6 address is too long for the structure defined to store the FROM parameter.
I have modified the structure tlv_from to support the storage of IPv6 addresses. The following gives the changes brought to this structure.
/* Original Version */
typedef struct _tlv_from
{
__u16 type;
__u16 length;
unsigned char addr[16];
} tlv_from;
/* Modified version */
typedef struct _tlv_from
{
__u16 type;
__u16 length;
struct sockaddr_storage addr;
} tlv_from;
Instead of using an array of char, the structure sockaddr_storage (which allows the storage of IPv4 and IPv6 addresses) is used. Some modifications have been brought in the hip_input.c and the hip_output.c files to adapt the code to this modification.