Merge authors: Diego Biurrun (diego-biurrun) ------------------------------------------------------------ revno: 6375 [merge] committer: Paul Tötterman <paul.totterman@xxxxxx> branch nick: methods-to-functions timestamp: Wed 2012-04-18 23:01:28 +0300 message: Merge from trunk modified: .dir-locals.el hipd/close.c hipd/cookie.c hipd/esp_prot_hipd_msg.c hipd/hidb.c hipd/hipd.c hipd/hiprelay.c hipd/init.c hipd/input.c hipd/opp_mode.c hipd/output.c hipfw/cert.c hipfw/conntrack.c hipfw/hipfw.c hipfw/midauth.c lib/core/builder.c lib/core/gpl/pk.c lib/core/protodefs.h lib/core/state.h modules/midauth/hipd/midauth.c modules/update/hipd/update_builder.c test/check_lib_core.c test/hipfw/midauth.c -- lp:hipl https://code.launchpad.net/~hipl-core/hipl/trunk Your team HIPL core team is subscribed to branch lp:hipl. To unsubscribe from this branch go to https://code.launchpad.net/~hipl-core/hipl/trunk/+edit-subscription
=== modified file '.dir-locals.el' --- .dir-locals.el 2011-06-29 14:44:02 +0000 +++ .dir-locals.el 2012-04-17 10:07:06 +0000 @@ -1,7 +1,9 @@ ; suitable Emacs defaults for the HIPL coding style -((nil . ((indent-tabs-mode . nil) - (tab-width . 4) - (show-trailing-whitespace . t))) - (c-mode . ((c-basic-offset . 4) - (c-indentation-style . "k&r"))) -) +((nil + (indent-tabs-mode) + (show-trailing-whitespace . t) + (tab-width . 4)) + (c-mode + (c-basic-offset . 4) + (c-file-style . "k&r")) + ) === modified file 'hipd/close.c' --- hipd/close.c 2012-03-21 13:14:54 +0000 +++ hipd/close.c 2012-04-17 11:20:20 +0000 @@ -240,7 +240,7 @@ hip_perf_start_benchmark(perf_set, PERF_HANDLE_CLOSE); #endif - HIP_IFEL(ipv6_addr_any(&ctx->input_msg->hitr), -1, + HIP_IFEL(ipv6_addr_any(&ctx->input_msg->hit_receiver), -1, "Received NULL receiver HIT in CLOSE. Dropping\n"); HIP_IFEL(!hip_controls_sane(ntohs(ctx->input_msg->control), 0), -1, @@ -360,13 +360,13 @@ #ifdef CONFIG_HIP_RVS if (hip_relay_get_status()) { struct hip_relrec dummy; - memcpy(&dummy.hit_r, &ctx->input_msg->hits, - sizeof(ctx->input_msg->hits)); + memcpy(&dummy.hit_r, &ctx->input_msg->hit_sender, + sizeof(ctx->input_msg->hit_sender)); hip_relht_rec_free_doall(&dummy); /* Check that the element really got deleted. */ if (hip_relht_get(&dummy) == NULL) { HIP_DEBUG_HIT("Deleted relay record for HIT", - &ctx->input_msg->hits); + &ctx->input_msg->hit_sender); } } #endif @@ -408,7 +408,7 @@ hip_perf_start_benchmark(perf_set, PERF_HANDLE_CLOSE_ACK); #endif - HIP_IFEL(ipv6_addr_any(&ctx->input_msg->hitr), -1, + HIP_IFEL(ipv6_addr_any(&ctx->input_msg->hit_receiver), -1, "Received NULL receiver HIT in CLOSE ACK. Dropping\n"); if (!hip_controls_sane(ntohs(ctx->input_msg->control), HIP_PACKET_CTRL_NON)) { === modified file 'hipd/cookie.c' --- hipd/cookie.c 2012-03-01 14:06:24 +0000 +++ hipd/cookie.c 2012-04-17 11:20:20 +0000 @@ -279,7 +279,7 @@ int err = 0; /* Find the proper R1 table */ - HIP_IFEL(!(hid = hip_get_hostid_entry_by_lhi_and_algo(&hdr->hitr, + HIP_IFEL(!(hid = hip_get_hostid_entry_by_lhi_and_algo(&hdr->hit_receiver, HIP_ANY_ALGO, -1)), -1, "Requested source HIT not (any more) available.\n"); @@ -317,8 +317,8 @@ } memcpy(puzzle_input.puzzle, solution->I, PUZZLE_LENGTH); - puzzle_input.initiator_hit = hdr->hits; - puzzle_input.responder_hit = hdr->hitr; + puzzle_input.initiator_hit = hdr->hit_sender; + puzzle_input.responder_hit = hdr->hit_receiver; memcpy(puzzle_input.solution, solution->J, PUZZLE_LENGTH); HIP_IFEL(hip_verify_puzzle_solution(&puzzle_input, solution->K), === modified file 'hipd/esp_prot_hipd_msg.c' --- hipd/esp_prot_hipd_msg.c 2012-03-01 14:06:24 +0000 +++ hipd/esp_prot_hipd_msg.c 2012-04-17 11:20:20 +0000 @@ -91,8 +91,8 @@ hip_build_network_hdr(resp_update, HIP_UPDATE, mask, - &recv_update->hitr, - &recv_update->hits); + &recv_update->hit_receiver, + &recv_update->hit_sender); /* Add ESP_INFO */ HIP_IFEL(hip_build_param_esp_info(resp_update, === modified file 'hipd/hidb.c' --- hipd/hidb.c 2012-03-20 13:08:56 +0000 +++ hipd/hidb.c 2012-04-17 11:20:20 +0000 @@ -541,8 +541,8 @@ bool anonymous; HIP_DEBUG("/* --------- */ \n"); - HIP_DEBUG_IN6ADDR("input->hits = ", &input->hits); - HIP_DEBUG_IN6ADDR("input->hitr = ", &input->hitr); + HIP_DEBUG_IN6ADDR("input->hit_sender = ", &input->hit_sender); + HIP_DEBUG_IN6ADDR("input->hit_receiver = ", &input->hit_receiver); if ((err = hip_get_msg_err(input)) != 0) { HIP_ERROR("daemon failed (%d)\n", err); return err; === modified file 'hipd/hipd.c' --- hipd/hipd.c 2012-03-20 21:45:03 +0000 +++ hipd/hipd.c 2012-04-16 14:47:42 +0000 @@ -310,7 +310,7 @@ HIP_IFEL(hipd_init(flags), 1, "hipd_init() failed!\n"); if (flags & HIPD_START_CREATE_CONFIG_AND_EXIT) { - HIP_ERROR("Config files create, exiting...\n"); + HIP_ERROR("Config files created, exiting...\n"); return 0; } === modified file 'hipd/hiprelay.c' --- hipd/hiprelay.c 2012-02-23 10:43:16 +0000 +++ hipd/hiprelay.c 2012-04-17 11:20:20 +0000 @@ -850,7 +850,8 @@ "No memory\n"); hip_build_network_hdr(msg_to_be_relayed, type_hdr, 0, - &ctx->input_msg->hits, &ctx->input_msg->hitr); + &ctx->input_msg->hit_sender, + &ctx->input_msg->hit_receiver); /* Notice that in most cases the incoming I1 has no paramaters at all, * and this "while" loop is skipped. Multiple rvses en route to responder @@ -961,7 +962,7 @@ "No memory to copy original I1\n"); hip_build_network_hdr(r_to_be_relayed, type_hdr, 0, - &r->hits, &r->hitr); + &r->hit_sender, &r->hit_receiver); while ((current_param = hip_get_next_param(r, current_param)) != NULL) { HIP_DEBUG("Found parameter in R.\n"); @@ -1016,9 +1017,10 @@ * I's HIT. We should find one, if the I is * registered to relay.*/ HIP_DEBUG_HIT("Searching relay record on HIT:", - &ctx->input_msg->hits); + &ctx->input_msg->hit_sender); - memcpy(&dummy.hit_r, &ctx->input_msg->hits, sizeof(ctx->input_msg->hits)); + memcpy(&dummy.hit_r, &ctx->input_msg->hit_sender, + sizeof(ctx->input_msg->hit_sender)); rec = hip_relht_get(&dummy); if (rec == NULL) { @@ -1157,13 +1159,13 @@ */ #ifdef CONFIG_HIP_RVS relay_ha_entry = - hip_hadb_find_rvs_candidate_entry(&source_msg->hitr, relay_ip); + hip_hadb_find_rvs_candidate_entry(&source_msg->hit_receiver, relay_ip); if (relay_ha_entry == NULL) { HIP_DEBUG_HIT("relay hit not found in the entry table rvs_ip:", relay_ip); HIP_DEBUG_HIT("relay hit not found in the entry table " - "&source_msg->hitr:", &source_msg->hitr); + "&source_msg->hit_receiver:", &source_msg->hit_receiver); HIP_DEBUG("The I1 packet was received from Relay, but the host " "association created during registration is not found. " "RVS_HMAC cannot be verified.\n"); === modified file 'hipd/init.c' --- hipd/init.c 2012-03-20 12:28:24 +0000 +++ hipd/init.c 2012-04-16 14:47:42 +0000 @@ -65,9 +65,9 @@ #include "lib/core/hostsfiles.h" #include "lib/core/ife.h" #include "lib/core/modularization.h" -#include "lib/core/gpl/nlink.h" #include "lib/core/performance.h" #include "lib/core/straddr.h" +#include "lib/core/gpl/nlink.h" #include "lib/core/gpl/xfrmapi.h" #include "modules/hipd_modules.h" #include "config.h" @@ -939,7 +939,7 @@ hip_init_hadb(); /* Resolve our current addresses, afterwards the events from kernel - * will maintain the list This needs to be done before opening + * will maintain the list. This needs to be done before opening * NETLINK_ROUTE! See the comment about address_count global var. */ HIP_DEBUG("Initializing the netdev_init_addresses\n"); @@ -971,10 +971,11 @@ HIP_IFEL(hip_raw_sock_output_v4 < 0, -1, "raw sock output v4\n"); /* hip_nat_sock_input should be initialized after hip_nat_sock_output - * because for the sockets bound to the same address/port, only the last socket seems - * to receive the packets. NAT input socket is a normal UDP socket where as - * NAT output socket is a raw socket. A raw output socket support better the "shotgun" - * extension (sending packets from multiple source addresses). */ + * because for the sockets bound to the same address/port, only the last + * socket seems to receive the packets. The NAT input socket is a normal + * UDP socket whereas NAT output socket is a raw socket. A raw output + * socket better supports the "shotgun" extension (sending packets + * from multiple source addresses). */ hip_nat_sock_output_udp = init_raw_sock_v4(IPPROTO_UDP); HIP_IFEL(hip_nat_sock_output_udp < 0, -1, "raw sock output udp\n"); === modified file 'hipd/input.c' --- hipd/input.c 2012-03-20 21:45:03 +0000 +++ hipd/input.c 2012-04-17 11:20:20 +0000 @@ -336,8 +336,8 @@ &km, keymat, keymat_len, - &ctx->input_msg->hits, - &ctx->input_msg->hitr, + &ctx->input_msg->hit_sender, + &ctx->input_msg->hit_receiver, &ctx->hadb_entry->keymat_calc_index, I, J); @@ -345,8 +345,8 @@ /* draw from km to keymat, copy keymat to dst, length of * keymat is len */ - we_are_HITg = hip_hit_is_bigger(&ctx->input_msg->hitr, - &ctx->input_msg->hits); + we_are_HITg = hip_hit_is_bigger(&ctx->input_msg->hit_receiver, + &ctx->input_msg->hit_sender); HIP_DEBUG("We are %s HIT.\n", we_are_HITg ? "greater" : "lesser"); @@ -500,10 +500,10 @@ } /* check for invalid loopback message */ - if (hip_hidb_hit_is_our(&ctx->input_msg->hits) && - (IN6_ARE_ADDR_EQUAL(&ctx->input_msg->hitr, - &ctx->input_msg->hits) || - IN6_ARE_ADDR_EQUAL(&ctx->input_msg->hitr, + if (hip_hidb_hit_is_our(&ctx->input_msg->hit_sender) && + (IN6_ARE_ADDR_EQUAL(&ctx->input_msg->hit_receiver, + &ctx->input_msg->hit_sender) || + IN6_ARE_ADDR_EQUAL(&ctx->input_msg->hit_receiver, &ipv6_any_addr)) && !hip_addr_is_loopback(&ctx->dst_addr) && !hip_addr_is_loopback(&ctx->src_addr) && @@ -514,8 +514,8 @@ /* Check packet destination */ /* I1 may be opportunistic with zero dst HIT */ - if (!hip_hidb_hit_is_our(&ctx->input_msg->hitr) && - !ipv6_addr_any(&ctx->input_msg->hitr)) { + if (!hip_hidb_hit_is_our(&ctx->input_msg->hit_receiver) && + !ipv6_addr_any(&ctx->input_msg->hit_receiver)) { HIP_DEBUG("Packet is not destined for this host.\n"); #ifdef CONFIG_HIP_RVS /* RVS/Relay is handled later in the code. */ @@ -537,12 +537,12 @@ type = hip_get_msg_type(ctx->input_msg); - ctx->hadb_entry = hip_hadb_find_byhits(&ctx->input_msg->hits, - &ctx->input_msg->hitr); + ctx->hadb_entry = hip_hadb_find_byhits(&ctx->input_msg->hit_sender, + &ctx->input_msg->hit_receiver); // Check if we need to drop the packet if (ctx->hadb_entry && - packet_to_drop(ctx->hadb_entry, type, &ctx->input_msg->hitr) == 1) { + packet_to_drop(ctx->hadb_entry, type, &ctx->input_msg->hit_receiver) == 1) { HIP_DEBUG("Ignoring the packet sent.\n"); return -1; } @@ -616,8 +616,8 @@ { #ifndef CONFIG_HIP_RVS int type = hip_get_msg_type(ctx->input_msg); - struct hip_hadb_state *entry = hip_hadb_find_byhits(&ctx->input_msg->hits, - &ctx->input_msg->hitr); + struct hip_hadb_state *entry = hip_hadb_find_byhits(&ctx->input_msg->hit_sender, + &ctx->input_msg->hit_receiver); /* The ip of RVS is taken to be ip of the peer while using RVS server * to relay R1. Hence have removed this part for RVS --Abi */ @@ -681,9 +681,9 @@ hip_handle_opp_r1(ctx); } - if (!hip_hidb_hit_is_our(&ctx->input_msg->hitr)) { + if (!hip_hidb_hit_is_our(&ctx->input_msg->hit_receiver)) { HIP_DEBUG_HIT("Dst HIT does not belong to this host", - &ctx->input_msg->hitr); + &ctx->input_msg->hit_receiver); return -1; } @@ -829,8 +829,8 @@ } memcpy(puzzle_input.puzzle, pz->I, PUZZLE_LENGTH); - puzzle_input.initiator_hit = ctx->input_msg->hitr; - puzzle_input.responder_hit = ctx->input_msg->hits; + puzzle_input.initiator_hit = ctx->input_msg->hit_receiver; + puzzle_input.responder_hit = ctx->input_msg->hit_sender; RAND_bytes(puzzle_input.solution, PUZZLE_LENGTH); if (hip_solve_puzzle(&puzzle_input, pz->K)) { @@ -850,8 +850,8 @@ hip_build_network_hdr(ctx->output_msg, HIP_I2, 0, - &ctx->input_msg->hitr, - &ctx->input_msg->hits); + &ctx->input_msg->hit_receiver, + &ctx->input_msg->hit_sender); /* note: we could skip keying material generation in the case * of a retransmission but then we'd had to fill ctx->hmac etc */ @@ -986,9 +986,9 @@ hip_perf_start_benchmark(perf_set, PERF_R2); #endif - if (!hip_hidb_hit_is_our(&ctx->input_msg->hitr)) { + if (!hip_hidb_hit_is_our(&ctx->input_msg->hit_receiver)) { HIP_DEBUG_HIT("Dst HIT does not belong to this host", - &ctx->input_msg->hitr); + &ctx->input_msg->hit_receiver); return -1; } @@ -1177,11 +1177,11 @@ #ifdef CONFIG_HIP_RVS if (hip_relay_get_status() != HIP_RELAY_OFF && - !hip_hidb_hit_is_our(&ctx->input_msg->hitr)) { + !hip_hidb_hit_is_our(&ctx->input_msg->hit_receiver)) { struct hip_relrec *rec = NULL, dummy; - memcpy(&dummy.hit_r, &ctx->input_msg->hitr, - sizeof(ctx->input_msg->hitr)); + memcpy(&dummy.hit_r, &ctx->input_msg->hit_receiver, + sizeof(ctx->input_msg->hit_receiver)); HIP_DEBUG_HIT("Searching relay record on HIT ", &dummy.hit_r); rec = hip_relht_get(&dummy); if (rec == NULL) { @@ -1244,7 +1244,7 @@ * arrive at the local host too. The following variable handles * that special case. Since we are using source HIT (and not * destination) it should handle also opportunistic I1 broadcast */ - int src_hit_is_our = hip_hidb_hit_is_our(&ctx->input_msg->hits); + int src_hit_is_our = hip_hidb_hit_is_our(&ctx->input_msg->hit_sender); /* check i1 for broadcast/multicast addresses */ if (IN6_IS_ADDR_V4MAPPED(&ctx->dst_addr)) { @@ -1356,14 +1356,14 @@ #ifdef CONFIG_HIP_RVS if (hip_relay_get_status() != HIP_RELAY_OFF && - !hip_hidb_hit_is_our(&ctx->input_msg->hitr)) { + !hip_hidb_hit_is_our(&ctx->input_msg->hit_receiver)) { struct hip_relrec *rec = NULL, dummy; /* Check if we have a relay record in our database matching the * Responder's HIT. We should find one if the Responder is * registered to relay. */ - memcpy(&dummy.hit_r, &ctx->input_msg->hitr, - sizeof(ctx->input_msg->hitr)); + memcpy(&dummy.hit_r, &ctx->input_msg->hit_receiver, + sizeof(ctx->input_msg->hit_receiver)); HIP_DEBUG_HIT("Searching relay record on HIT ", &dummy.hit_r); rec = hip_relht_get(&dummy); if (rec == NULL) { @@ -1377,9 +1377,9 @@ } #endif - if (!hip_hidb_hit_is_our(&ctx->input_msg->hitr)) { + if (!hip_hidb_hit_is_our(&ctx->input_msg->hit_receiver)) { HIP_DEBUG_HIT("Dst HIT does not belong to this host", - &ctx->input_msg->hitr); + &ctx->input_msg->hit_receiver); return -1; } @@ -1416,10 +1416,10 @@ "Out of memory when allocating memory for a new HIP " "association. Dropping the I2 packet.\n"); - ipv6_addr_copy(&ctx->hadb_entry->hit_peer, &ctx->input_msg->hits); + ipv6_addr_copy(&ctx->hadb_entry->hit_peer, &ctx->input_msg->hit_sender); ipv6_addr_copy(&ctx->hadb_entry->our_addr, &ctx->dst_addr); HIP_DEBUG("Initializing the HIP association.\n"); - hip_init_us(ctx->hadb_entry, &ctx->input_msg->hitr); + hip_init_us(ctx->hadb_entry, &ctx->input_msg->hit_receiver); hip_hadb_insert_state(ctx->hadb_entry); } @@ -1451,8 +1451,8 @@ } /* Verify HMAC. */ - if (hip_hidb_hit_is_our(&ctx->input_msg->hits) && - hip_hidb_hit_is_our(&ctx->input_msg->hitr)) { + if (hip_hidb_hit_is_our(&ctx->input_msg->hit_sender) && + hip_hidb_hit_is_our(&ctx->input_msg->hit_receiver)) { is_loopback = 1; ctx->hadb_entry->is_loopback = 1; HIP_IFEL(hip_verify_packet_hmac(ctx->input_msg, @@ -1682,7 +1682,7 @@ /* If there was already state, these may be uninitialized */ if (!ctx->hadb_entry->our_pub) { - hip_init_us(ctx->hadb_entry, &ctx->input_msg->hitr); + hip_init_us(ctx->hadb_entry, &ctx->input_msg->hit_receiver); } /* If the incoming I2 packet has hip_get_nat_udp_port() as destination port, NAT * mode is set on for the host association, I2 source port is === modified file 'hipd/opp_mode.c' --- hipd/opp_mode.c 2011-10-25 21:14:16 +0000 +++ hipd/opp_mode.c 2012-04-17 11:20:20 +0000 @@ -81,12 +81,12 @@ struct hip_hadb_state *entry = NULL; if (type == HIP_I1) { - if (!ipv6_addr_is_null(&msg->hitr)) { + if (!ipv6_addr_is_null(&msg->hit_receiver)) { return NULL; } - hip_get_default_hit(&msg->hitr); + hip_get_default_hit(&msg->hit_receiver); } else if (type == HIP_R1) { - entry = opp_get_hadb_entry(&msg->hitr, src_addr); + entry = opp_get_hadb_entry(&msg->hit_receiver, src_addr); } else { HIP_ASSERT(0); } @@ -108,22 +108,22 @@ opp_entry = ctx->hadb_entry; - HIP_DEBUG_HIT("peer hit", &ctx->input_msg->hits); - HIP_DEBUG_HIT("local hit", &ctx->input_msg->hitr); + HIP_DEBUG_HIT("peer hit", &ctx->input_msg->hit_sender); + HIP_DEBUG_HIT("local hit", &ctx->input_msg->hit_receiver); - HIP_IFEL(hip_hadb_add_peer_info_complete(&ctx->input_msg->hitr, - &ctx->input_msg->hits, + HIP_IFEL(hip_hadb_add_peer_info_complete(&ctx->input_msg->hit_receiver, + &ctx->input_msg->hit_sender, NULL, &ctx->dst_addr, &ctx->src_addr, NULL), -1, "Failed to insert peer map\n"); - HIP_IFEL(!(ctx->hadb_entry = hip_hadb_find_byhits(&ctx->input_msg->hits, - &ctx->input_msg->hitr)), + HIP_IFEL(!(ctx->hadb_entry = hip_hadb_find_byhits(&ctx->input_msg->hit_sender, + &ctx->input_msg->hit_receiver)), -1, "Did not find opp entry\n"); - HIP_IFEL(hip_init_us(ctx->hadb_entry, &ctx->input_msg->hitr), + HIP_IFEL(hip_init_us(ctx->hadb_entry, &ctx->input_msg->hit_receiver), -1, "hip_init_us failed\n"); /* old HA has state 2, new HA has state 1, so copy it */ ctx->hadb_entry->state = opp_entry->state; @@ -135,8 +135,8 @@ HIP_DEBUG("RVS: Error moving the pending requests to a new HA"); } - HIP_DEBUG_HIT("peer hit", &ctx->input_msg->hits); - HIP_DEBUG_HIT("local hit", &ctx->input_msg->hitr); + HIP_DEBUG_HIT("peer hit", &ctx->input_msg->hit_sender); + HIP_DEBUG_HIT("local hit", &ctx->input_msg->hit_receiver); HIP_IFEL(hip_opportunistic_ipv6_to_hit(&ctx->src_addr, &phit, HIP_HIT_TYPE_HASH100), === modified file 'hipd/output.c' --- hipd/output.c 2012-03-20 12:52:49 +0000 +++ hipd/output.c 2012-04-16 14:47:42 +0000 @@ -132,10 +132,10 @@ { int err = 0; - /* If hitr is hashed NULL hit, send it as NULL on the wire. + /* If hit_receiver is a hashed NULL HIT, send it as NULL on the wire. * This case is an opportunistic BEX. */ - if (hit_is_opportunistic_hit(&i1->hitr)) { - ipv6_addr_copy(&i1->hitr, &in6addr_any); + if (hit_is_opportunistic_hit(&i1->hit_receiver)) { + ipv6_addr_copy(&i1->hit_receiver, &in6addr_any); } if (local_addr) { @@ -213,8 +213,8 @@ /* Calculate the HIP header length */ hip_calc_hdr_len(i1); - HIP_DEBUG_HIT("HIT source", &i1->hits); - HIP_DEBUG_HIT("HIT dest", &i1->hitr); + HIP_DEBUG_HIT("HIT source", &i1->hit_sender); + HIP_DEBUG_HIT("HIT dest", &i1->hit_receiver); HIP_DEBUG("Sending I1 to the following addresses:\n"); print_peer_addresses_to_be_added(entry); @@ -261,8 +261,8 @@ */ static int add_echo_response(struct hip_packet_context *ctx, int sign) { - int param_type = sign ? - HIP_PARAM_ECHO_REQUEST_SIGN : HIP_PARAM_ECHO_REQUEST; + int param_type = sign ? HIP_PARAM_ECHO_REQUEST_SIGN + : HIP_PARAM_ECHO_REQUEST; const struct hip_echo_msg *ping = hip_get_param(ctx->input_msg, param_type); @@ -465,7 +465,7 @@ /* add host id in plaintext without encrypted wrapper */ /* Parameter HOST_ID. Notice that hip_get_public_key overwrites * the argument pointer, so we have to allocate some extra memory */ - HIP_IFEL(!(host_id_entry = hip_get_hostid_entry_by_lhi_and_algo(&ctx->input_msg->hitr, + HIP_IFEL(!(host_id_entry = hip_get_hostid_entry_by_lhi_and_algo(&ctx->input_msg->hit_receiver, HIP_ANY_ALGO, -1)), -1, "Unknown HIT\n"); @@ -845,7 +845,7 @@ /* It should not be NULL hit, NULL hit has been replaced by real local * hit. */ - HIP_ASSERT(!hit_is_opportunistic_hit(&ctx->input_msg->hitr)); + HIP_ASSERT(!hit_is_opportunistic_hit(&ctx->input_msg->hit_receiver)); /* Case: I ----->IPv4---> RVS ---IPv6---> R */ if (IN6_IS_ADDR_V4MAPPED(r1_src_addr) != @@ -862,16 +862,16 @@ } HIP_IFEL(!(r1pkt = hip_get_r1(r1_dst_addr, &ctx->dst_addr, - &ctx->input_msg->hitr)), + &ctx->input_msg->hit_receiver)), -ENOENT, "No precreated R1\n"); - if (&ctx->input_msg->hits) { - ipv6_addr_copy(&r1pkt->hitr, &ctx->input_msg->hits); + if (&ctx->input_msg->hit_sender) { + ipv6_addr_copy(&r1pkt->hit_receiver, &ctx->input_msg->hit_sender); } else { - memset(&r1pkt->hitr, 0, sizeof(struct in6_addr)); + memset(&r1pkt->hit_receiver, 0, sizeof(struct in6_addr)); } - HIP_DEBUG_HIT("hip_xmit_r1(): ripkt->hitr", &r1pkt->hitr); + HIP_DEBUG_HIT("hip_xmit_r1(): r1pkt->hit_receiver", &r1pkt->hit_receiver); #ifdef CONFIG_HIP_RVS /** @todo Parameters must be in ascending order, should this === modified file 'hipfw/cert.c' --- hipfw/cert.c 2012-03-21 13:59:10 +0000 +++ hipfw/cert.c 2012-04-16 14:47:42 +0000 @@ -53,7 +53,7 @@ #include "cert.h" // runtime configuration -static int use_cert = false; +static int use_cert = false; static STACK_OF(X509) *root_chain = NULL; === modified file 'hipfw/conntrack.c' --- hipfw/conntrack.c 2012-03-27 12:51:53 +0000 +++ hipfw/conntrack.c 2012-04-16 14:47:42 +0000 @@ -228,8 +228,8 @@ return NULL; } - memcpy(&data->src_hit, &common->hits, sizeof(struct in6_addr)); - memcpy(&data->dst_hit, &common->hitr, sizeof(struct in6_addr)); + memcpy(&data->src_hit, &common->hit_sender, sizeof(struct in6_addr)); + memcpy(&data->dst_hit, &common->hit_receiver, sizeof(struct in6_addr)); return data; } @@ -895,7 +895,7 @@ return -1; } - tuple = get_tuple_by_hits(&common->hits, &common->hitr); + tuple = get_tuple_by_hits(&common->hit_sender, &common->hit_receiver); if (!tuple || esp_tuple_from_esp_info(esp_info, ctx, tuple)) { HIP_ERROR("unable to create esp state from UPDATE packet\n"); @@ -962,8 +962,9 @@ HIP_IFEL(!(tuple = get_tuple_by_esp(NULL, spi)), 0, "No tuple, skip\n"); - HIP_IFEL(!(reverse_tuple = get_tuple_by_hits(&common->hits, &common->hitr)), 0, - "No reverse tuple, skip\n"); + HIP_IFEL(!(reverse_tuple = get_tuple_by_hits(&common->hit_sender, + &common->hit_receiver)), + 0, "No reverse tuple, skip\n"); HIP_DEBUG("tuple src=%d dst=%d\n", tuple->src_port, tuple->dst_port); HIP_DEBUG("tuple dir=%d, sport=%d, dport=%d, rel=%d\n", tuple->direction, @@ -1058,7 +1059,7 @@ hip_host_id_to_hit(host_id, &hit, HIP_HIT_TYPE_HASH100); // match received hit and calculated hit - HIP_IFEL(ipv6_addr_cmp(&hit, &common->hits), 1, + HIP_IFEL(ipv6_addr_cmp(&hit, &common->hit_sender), 1, "HI -> HIT mapping does NOT match\n"); HIP_INFO("HI -> HIT mapping verified\n"); @@ -1113,7 +1114,7 @@ * Process an I1 packet. This function sets up a new connection for the HIT * tuple conveyed in the packet's HIP header. * - * @param common the R1 packet + * @param common the I1 packet * @param tuple the corresponding connection tuple * @param ctx the context * @@ -1127,7 +1128,6 @@ if (tuple) { HIP_DEBUG("I1 for existing connection, " "re-establishing connection state\n"); - remove_connection(tuple->connection); } @@ -1171,8 +1171,8 @@ return 0; } - //if peer hit is all-zero in I1 packet, replace it with pseudo hit - if (IN6_ARE_ADDR_EQUAL(&common->hitr, &all_zero_addr)) { + /* If peer HIT is all-zero in I1 packet, replace it with pseudo HIT. */ + if (IN6_ARE_ADDR_EQUAL(&common->hit_receiver, &all_zero_addr)) { hip_opportunistic_ipv6_to_hit(&ctx->dst, &phit, HIP_HIT_TYPE_HASH100); data->dst_hit = phit; @@ -1184,7 +1184,8 @@ return 0; } - tuple = get_tuple_by_hits(&data->src_hit, &data->dst_hit); + tuple = get_tuple_by_hits(&data->src_hit, + &data->dst_hit); tuple->connection->state = HIP_STATE_I1_SENT; free(data); @@ -1242,7 +1243,7 @@ struct tuple *const tuple, struct hip_fw_context *const ctx) { - const struct hip_esp_info *const esp_info = hip_get_param(common, HIP_PARAM_ESP_INFO); + const struct hip_esp_info *const esp_info = hip_get_param(common, HIP_PARAM_ESP_INFO); if (!hipfw_midauth_verify_challenge(ctx, common)) { HIP_ERROR("failed to verify midauth challenge\n"); @@ -1291,7 +1292,7 @@ struct tuple *const tuple, const struct hip_fw_context *const ctx) { - const struct hip_esp_info *const esp_info = hip_get_param(common, HIP_PARAM_ESP_INFO); + const struct hip_esp_info *const esp_info = hip_get_param(common, HIP_PARAM_ESP_INFO); if (!hipfw_midauth_verify_challenge(ctx, common)) { HIP_ERROR("failed to verify midauth challenge\n"); @@ -1484,7 +1485,6 @@ ntohl(esp_info->old_spi)))) { HIP_DEBUG("existing ESP state does not include current SPI, " "re-establishing connection state\n"); - remove_connection(tuple->connection); if (insert_connection_from_update(common, ctx, esp_info)) { @@ -1587,7 +1587,8 @@ /* if there was no tuple before, the previous packet processing will have * created it */ if (!tuple) { - tuple = get_tuple_by_hits(&common->hits, &common->hitr); + tuple = get_tuple_by_hits(&common->hit_sender, + &common->hit_receiver); } if (!tuple || !hipfw_midauth_add_challenge(ctx, common)) { @@ -2317,7 +2318,6 @@ HIP_DEBUG("Connection timed out:\n"); HIP_DEBUG_HIT("src HIT", &conn->original.hip_tuple->data->src_hit); HIP_DEBUG_HIT("dst HIT", &conn->original.hip_tuple->data->dst_hit); - remove_connection(conn); } } === modified file 'hipfw/hipfw.c' --- hipfw/hipfw.c 2012-03-20 21:45:03 +0000 +++ hipfw/hipfw.c 2012-04-16 14:55:53 +0000 @@ -887,38 +887,48 @@ HIP_DEBUG("HIP type number is %d\n", buf->type_hdr); - if (buf->type_hdr == HIP_I1) { + switch (buf->type_hdr) { + case HIP_I1: HIP_INFO("received packet type: I1\n"); print_addr = 1; - } else if (buf->type_hdr == HIP_R1) { + break; + case HIP_R1: HIP_INFO("received packet type: R1\n"); print_addr = 1; - } else if (buf->type_hdr == HIP_I2) { + break; + case HIP_I2: HIP_INFO("received packet type: I2\n"); print_addr = 1; - } else if (buf->type_hdr == HIP_R2) { + break; + case HIP_R2: HIP_INFO("received packet type: R2\n"); print_addr = 1; - } else if (buf->type_hdr == HIP_UPDATE) { + break; + case HIP_UPDATE: HIP_INFO("received packet type: UPDATE\n"); print_addr = 1; - } else if (buf->type_hdr == HIP_CLOSE) { + break; + case HIP_CLOSE: HIP_INFO("received packet type: CLOSE\n"); print_addr = 1; - } else if (buf->type_hdr == HIP_CLOSE_ACK) { + break; + case HIP_CLOSE_ACK: HIP_INFO("received packet type: CLOSE_ACK\n"); print_addr = 1; - } else if (buf->type_hdr == HIP_NOTIFY) { + break; + case HIP_NOTIFY: HIP_DEBUG("received packet type: NOTIFY\n"); - } else if (buf->type_hdr == HIP_LUPDATE) { + break; + case HIP_LUPDATE: HIP_DEBUG("received packet type: LIGHT UPDATE\n"); - } else { + break; + default: HIP_DEBUG("received packet type: UNKNOWN\n"); } if (print_addr) { - HIP_INFO_HIT("src hit", &buf->hits); - HIP_INFO_HIT("dst hit", &buf->hitr); + HIP_INFO_HIT("src hit", &buf->hit_sender); + HIP_INFO_HIT("dst hit", &buf->hit_receiver); HIP_INFO_IN6ADDR("src ip", &ctx->src); HIP_INFO_IN6ADDR("dst ip", &ctx->dst); } @@ -931,8 +941,7 @@ if (match && rule->src_hit) { HIP_DEBUG("src_hit\n"); - if (!match_hit(rule->src_hit->value, - buf->hits, + if (!match_hit(rule->src_hit->value, buf->hit_sender, rule->src_hit->boolean)) { match = 0; } @@ -942,8 +951,7 @@ if (match && rule->dst_hit) { HIP_DEBUG("dst_hit\n"); - if (!match_hit(rule->dst_hit->value, - buf->hitr, + if (!match_hit(rule->dst_hit->value, buf->hit_receiver, rule->dst_hit->boolean)) { match = 0; } @@ -952,17 +960,14 @@ // check the HIP packet type (I1, UPDATE, etc.) if (match && rule->type) { HIP_DEBUG("type\n"); - if (!match_int(rule->type->value, - buf->type_hdr, + if (!match_int(rule->type->value, buf->type_hdr, rule->type->boolean)) { match = 0; } HIP_DEBUG("type rule: %d, packet: %d, boolean: %d, match: %d\n", - rule->type->value, - buf->type_hdr, - rule->type->boolean, - match); + rule->type->value, buf->type_hdr, + rule->type->boolean, match); } /* this checks, if the the input interface of the packet @@ -974,15 +979,13 @@ } HIP_DEBUG("in_if rule: %s, packet: %s, boolean: %d, match: %d \n", - rule->in_if->value, - in_if, rule->in_if->boolean, match); + rule->in_if->value, in_if, rule->in_if->boolean, match); } /* this checks, if the the output interface of the packet matches the * one specified in the rule */ if (match && rule->out_if) { - if (!match_string(rule->out_if->value, - out_if, + if (!match_string(rule->out_if->value, out_if, rule->out_if->boolean)) { match = 0; } @@ -996,7 +999,8 @@ * must be last, so not called if packet is going to be * dropped */ if (match && rule->state) { - int filter_state_verdict = filter_state(buf, rule->state, rule->accept, ctx); + int filter_state_verdict = filter_state(buf, rule->state, + rule->accept, ctx); /* we at least had some packet before -> check * this packet this will also check the signature of @@ -1320,9 +1324,7 @@ // check if packet is to big for the buffer if (ctx->ipq_packet->data_len > HIP_MAX_PACKET) { HIP_ERROR("packet size greater than buffer\n"); - - err = 1; - goto end_init; + return 1; } ctx->ip_version = ip_version; @@ -1360,7 +1362,7 @@ ctx->transport_hdr.hip = (struct hip_common *) (((char *) iphdr) + ctx->ip_hdr_len); - goto end_init; + return err; } else if (iphdr->ip_p == IPPROTO_ESP) { // this is an ESP packet HIP_DEBUG("plain ESP packet\n"); @@ -1369,12 +1371,12 @@ ctx->transport_hdr.esp = (struct hip_esp *) (((char *) iphdr) + ctx->ip_hdr_len); - goto end_init; + return err; } else if (iphdr->ip_p != IPPROTO_UDP) { // if it's not UDP either, it's unsupported HIP_DEBUG("some other packet\n"); - goto end_init; + return err; } // need UDP header to look for encapsulated ESP @@ -1415,7 +1417,7 @@ ctx->transport_hdr.hip = (struct hip_common *) (((char *) ip6_hdr) + sizeof(struct ip6_hdr)); - goto end_init; + return err; } else if (ip6_hdr->ip6_nxt == IPPROTO_ESP) { // we have found a plain ESP packet HIP_DEBUG("plain ESP packet\n"); @@ -1424,12 +1426,12 @@ ctx->transport_hdr.esp = (struct hip_esp *) (((char *) ip6_hdr) + sizeof(struct ip6_hdr)); - goto end_init; + return err; } else if (ip6_hdr->ip6_nxt != IPPROTO_UDP) { // if it's not UDP either, it's unsupported HIP_DEBUG("some other packet\n"); - goto end_init; + return err; } /* for now these calculations are not necessary as UDP encapsulation @@ -1447,10 +1449,10 @@ ctx->udp_encap_hdr = udphdr; } else { HIP_DEBUG("neither ipv4 nor ipv6\n"); - goto end_init; + return err; } - HIP_DEBUG("UDP header size is %d (in header: %u) \n", + HIP_DEBUG("UDP header size is %d (in header: %u)\n", sizeof(struct udphdr), ntohs(udphdr->len)); HIP_DEBUG("UDP src port: %u\n", ntohs(udphdr->source)); HIP_DEBUG("UDP dst port: %u\n", ntohs(udphdr->dest)); @@ -1480,7 +1482,7 @@ // only UDP header + payload < 32 bit -> neither HIP nor ESP HIP_DEBUG("UDP packet with < 32 bit payload\n"); - goto end_init; + return err; } } @@ -1503,7 +1505,7 @@ + sizeof(struct udphdr) + HIP_UDP_ZERO_BYTES_LEN); - goto end_init; + return err; } HIP_ERROR("communicating with BROKEN peer implementation of UDP encapsulation," " found zero bytes when receiving HIP control message\n"); @@ -1522,13 +1524,12 @@ ctx->transport_hdr.esp = (struct hip_esp *) (((char *) udphdr) + sizeof(struct udphdr)); - goto end_init; + return err; } else { /* normal UDP packet or UDP encapsulated IPv6 */ HIP_DEBUG("normal UDP packet\n"); } -end_init: return err; } === modified file 'hipfw/midauth.c' --- hipfw/midauth.c 2012-03-20 09:44:54 +0000 +++ hipfw/midauth.c 2012-04-17 11:20:20 +0000 @@ -197,8 +197,8 @@ request.K = DEFAULT_DIFFICULTY; request.lifetime = lifetime(DEFAULT_DIFFICULTY); - if (build_midauth_opaque(request.opaque, common->hits, common->hitr, - current_nonce) == -1) { + if (build_midauth_opaque(request.opaque, common->hit_sender, + common->hit_receiver, current_nonce) == -1) { HIP_ERROR("Failed to generate CHALLENGE_REQUEST nonce\n"); return ignore_missing_challenge_request; } @@ -276,7 +276,8 @@ uint8_t nonce[MIDAUTH_DEFAULT_NONCE_LENGTH]; unsigned nonce_index = (current_nonce + i) % MIDAUTH_NONCES; - if (build_midauth_opaque(nonce, common->hitr, common->hits, nonce_index) == -1) { + if (build_midauth_opaque(nonce, common->hit_receiver, + common->hit_sender, nonce_index) == -1) { return ERROR; } else if (!memcmp(response->opaque, nonce, MIDAUTH_DEFAULT_NONCE_LENGTH)) { match = true; @@ -301,8 +302,8 @@ HIP_ERROR("failed to derive midauth puzzle\n"); return ERROR; } - tmp_puzzle.initiator_hit = hip->hits; - tmp_puzzle.responder_hit = hip->hitr; + tmp_puzzle.initiator_hit = hip->hit_sender; + tmp_puzzle.responder_hit = hip->hit_receiver; memcpy(tmp_puzzle.solution, response->J, PUZZLE_LENGTH); if (hip_verify_puzzle_solution(&tmp_puzzle, response->K)) { === modified file 'lib/core/builder.c' --- lib/core/builder.c 2012-03-20 21:45:03 +0000 +++ lib/core/builder.c 2012-04-17 11:20:20 +0000 @@ -1231,8 +1231,8 @@ * length of padding. */ size_t total_len = 0, pad_len = 0; HIP_DEBUG("--------------- MSG START ------------------\n"); - HIP_DEBUG_HIT("HIT Sender ", &msg->hits); - HIP_DEBUG_HIT("HIT Receiver", &msg->hitr); + HIP_DEBUG_HIT("HIT Sender ", &msg->hit_sender); + HIP_DEBUG_HIT("HIT Receiver", &msg->hit_receiver); HIP_DEBUG("Msg type : %s (%d)\n", hip_get_msg_type_name(hip_get_msg_type(msg)), hip_get_msg_type(msg)); @@ -1678,8 +1678,10 @@ msg->control = htons(control); msg->checksum = htons(0); /* this will be written by xmit */ - ipv6_addr_copy(&msg->hits, hit_sender ? hit_sender : &in6addr_any); - ipv6_addr_copy(&msg->hitr, hit_receiver ? hit_receiver : &in6addr_any); + ipv6_addr_copy(&msg->hit_sender, + hit_sender ? hit_sender : &in6addr_any); + ipv6_addr_copy(&msg->hit_receiver, + hit_receiver ? hit_receiver : &in6addr_any); } /** @@ -1852,21 +1854,21 @@ return -EPROTOTYPE; } - HIP_IFEL(!ipv6_addr_is_hit(&hip_common->hits), -EAFNOSUPPORT, + HIP_IFEL(!ipv6_addr_is_hit(&hip_common->hit_sender), -EAFNOSUPPORT, "Received a non-HIT in HIT-source. Dropping\n"); - HIP_IFEL(!ipv6_addr_is_hit(&hip_common->hitr) && - !ipv6_addr_any(&hip_common->hitr), + HIP_IFEL(!ipv6_addr_is_hit(&hip_common->hit_receiver) && + !ipv6_addr_any(&hip_common->hit_receiver), -EAFNOSUPPORT, "Received a non-HIT or non NULL in HIT-receiver. Dropping\n"); - HIP_IFEL(ipv6_addr_any(&hip_common->hits), -EAFNOSUPPORT, + HIP_IFEL(ipv6_addr_any(&hip_common->hit_sender), -EAFNOSUPPORT, "Received a NULL in HIT-sender. Dropping\n"); /** @todo handle the RVS case better. */ - if (ipv6_addr_any(&hip_common->hitr)) { + if (ipv6_addr_any(&hip_common->hit_receiver)) { HIP_DEBUG("Received a connection to opportunistic HIT\n"); } else { - HIP_DEBUG_HIT("Received a connection to HIT", &hip_common->hitr); + HIP_DEBUG_HIT("Received a connection to HIT", &hip_common->hit_receiver); } /* Check checksum. */ === modified file 'lib/core/gpl/pk.c' --- lib/core/gpl/pk.c 2011-11-10 10:35:47 +0000 +++ lib/core/gpl/pk.c 2012-04-17 11:20:20 +0000 @@ -196,7 +196,7 @@ HIP_IFEL(!peer_pub, -1, "NULL public key\n"); HIP_IFEL(!msg, -1, "NULL message\n"); - ipv6_addr_copy(&tmpaddr, &msg->hitr); /* so update is handled, too */ + ipv6_addr_copy(&tmpaddr, &msg->hit_receiver); /* so update is handled, too */ origlen = hip_get_msg_total_len(msg); if (hip_get_msg_type(msg) == HIP_R1) { @@ -204,7 +204,7 @@ HIP_PARAM_HIP_SIGNATURE2)), -ENOENT, "Could not find signature2\n"); - memset(&msg->hitr, 0, sizeof(struct in6_addr)); + memset(&msg->hit_receiver, 0, sizeof(struct in6_addr)); HIP_IFEL(!(pz = hip_get_param_readwrite(msg, HIP_PARAM_PUZZLE)), -ENOENT, "Illegal R1 packet (puzzle missing)\n"); @@ -254,7 +254,7 @@ memcpy(pz->I, rand_i, PUZZLE_LENGTH); } - ipv6_addr_copy(&msg->hitr, &tmpaddr); + ipv6_addr_copy(&msg->hit_receiver, &tmpaddr); if (err) { err = -1; === modified file 'lib/core/protodefs.h' --- lib/core/protodefs.h 2012-03-20 13:08:56 +0000 +++ lib/core/protodefs.h 2012-04-17 11:20:20 +0000 @@ -701,8 +701,8 @@ uint8_t ver_res; uint16_t checksum; uint16_t control; - struct in6_addr hits; /**< Sender HIT */ - struct in6_addr hitr; /**< Receiver HIT */ + struct in6_addr hit_sender; + struct in6_addr hit_receiver; } __attribute__((packed)); struct hip_common_user { @@ -711,8 +711,8 @@ uint8_t version; uint16_t error; uint16_t control; - struct in6_addr hitr; /* unused */ - struct in6_addr hits; /* unused */ + struct in6_addr hit_receiver; + struct in6_addr hit_sender; } __attribute__((packed)); /** === modified file 'lib/core/state.h' --- lib/core/state.h 2012-03-14 18:28:39 +0000 +++ lib/core/state.h 2012-04-16 14:47:42 +0000 @@ -297,9 +297,9 @@ struct timeval bex_start; struct timeval bex_end; - uint32_t pacing; - uint8_t ice_control_role; - struct hip_esp_info *nat_esp_info; + uint32_t pacing; + uint8_t ice_control_role; + struct hip_esp_info *nat_esp_info; /** disable SAs on this HA (currently used only by full relay) */ int disable_sas; === modified file 'modules/midauth/hipd/midauth.c' --- modules/midauth/hipd/midauth.c 2012-01-16 22:06:09 +0000 +++ modules/midauth/hipd/midauth.c 2012-04-17 11:20:20 +0000 @@ -79,8 +79,8 @@ return -1; } - tmp_puzzle.initiator_hit = ctx->input_msg->hitr; - tmp_puzzle.responder_hit = ctx->input_msg->hits; + tmp_puzzle.initiator_hit = ctx->input_msg->hit_receiver; + tmp_puzzle.responder_hit = ctx->input_msg->hit_sender; if (hip_solve_puzzle(&tmp_puzzle, request->K)) { HIP_ERROR("Solving of middlebox challenge failed\n"); @@ -125,7 +125,7 @@ // add HOST_ID to packets containing a CHALLENGE_RESPONSE if (challenge_request) { const struct local_host_id *const host_id_entry = - hip_get_hostid_entry_by_lhi_and_algo(&ctx->input_msg->hitr, + hip_get_hostid_entry_by_lhi_and_algo(&ctx->input_msg->hit_receiver, HIP_ANY_ALGO, -1); if (!host_id_entry) { === modified file 'modules/update/hipd/update_builder.c' --- modules/update/hipd/update_builder.c 2012-02-15 17:37:10 +0000 +++ modules/update/hipd/update_builder.c 2012-04-17 11:20:20 +0000 @@ -107,7 +107,7 @@ HIP_IFEL(!(locator = malloc(sizeof(struct hip_locator) + addrs_len)), -ENOMEM, "Could not allocate space for locator parameter\n"); - HIP_IFEL(!(ha = hip_hadb_find_byhits(&msg->hits, &msg->hitr)), + HIP_IFEL(!(ha = hip_hadb_find_byhits(&msg->hit_sender, &msg->hit_receiver)), -1, "Could not retrieve HA\n"); hip_set_param_type((struct hip_tlv_common *) locator, HIP_PARAM_LOCATOR); === modified file 'test/check_lib_core.c' --- test/check_lib_core.c 2012-03-13 15:27:06 +0000 +++ test/check_lib_core.c 2012-04-16 14:47:42 +0000 @@ -35,7 +35,7 @@ int main(void) { - int number_failed; + int number_failed; SRunner *sr = srunner_create(NULL); srunner_add_suite(sr, lib_core_cert()); === modified file 'test/hipfw/midauth.c' --- test/hipfw/midauth.c 2012-03-20 09:50:42 +0000 +++ test/hipfw/midauth.c 2012-04-17 11:20:20 +0000 @@ -130,12 +130,13 @@ HIP_DEBUG("Testing verify_response on non-matching inputs\n"); - common.hits = in6addr_any; - common.hitr = in6addr_any; + common.hit_sender = in6addr_any; + common.hit_receiver = in6addr_any; hipfw_midauth_update_nonces(); - build_midauth_opaque(midauth_nonce, common.hits, common.hitr, 1); + build_midauth_opaque(midauth_nonce, common.hit_sender, + common.hit_receiver, 1); hip_set_param_contents_len(&response.tlv, 30); memcpy(response.opaque, midauth_nonce, MIDAUTH_DEFAULT_NONCE_LENGTH); @@ -161,12 +162,12 @@ // build context ctx.transport_hdr.hip = &hip; - hip.hits = in6addr_any; - hip.hitr = in6addr_any; + hip.hit_sender = in6addr_any; + hip.hit_receiver = in6addr_any; hipfw_midauth_update_nonces(); - build_midauth_opaque(midauth_nonce, hip.hitr, hip.hits, 1); + build_midauth_opaque(midauth_nonce, hip.hit_receiver, hip.hit_sender, 1); // build response fail_unless(hip_midauth_puzzle_seed(midauth_nonce, MIDAUTH_DEFAULT_NONCE_LENGTH, tmp_puzzle.puzzle) == 0, NULL); @@ -196,13 +197,13 @@ // build context hip = hip_msg_alloc(); - hip->hits = in6addr_any; - hip->hitr = in6addr_any; + hip->hit_sender = in6addr_any; + hip->hit_receiver = in6addr_any; ctx.transport_hdr.hip = hip; hipfw_midauth_update_nonces(); - build_midauth_opaque(midauth_nonce, hip->hits, hip->hitr, 1); + build_midauth_opaque(midauth_nonce, hip->hit_sender, hip->hit_receiver, 1); // build request request.K = 1;