Committer: Tim Just <tim.just@xxxxxxxxxxxxxx> Date: Wed Feb 24 16:12:39 2010 +0100 Revision: 3572 Revision-id: tim.just@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Branch nick: tiny Log: Handling of CLOSE_ACK packets now uses libmodularization. Modified: M hipd/close.c M hipd/init.c M hipd/input.c === modified file 'hipd/close.c' --- hipd/close.c 2010-02-24 15:05:30 +0000 +++ hipd/close.c 2010-02-24 15:12:39 +0000 @@ -311,10 +311,9 @@ goto out_err; } - if (!ctx->hadb_entry) { - HIP_DEBUG("No HA for the received close ack\n"); - goto out_err; - } + HIP_IFEL(!ctx->hadb_entry, -1, + "No entry in host association database when receiving R2." \ + "Dropping.\n"); switch (ha_state) { case HIP_STATE_CLOSING: === modified file 'hipd/init.c' --- hipd/init.c 2010-02-24 15:05:30 +0000 +++ hipd/init.c 2010-02-24 15:12:39 +0000 @@ -524,6 +524,26 @@ hip_perf_write_benchmark(perf_set, PERF_HANDLE_CLOSE); #endif #endif + + hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_UNASSOCIATED, &hip_drop_packet, 0); + hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_I1_SENT, &hip_drop_packet, 0); + hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_I2_SENT, &hip_drop_packet, 0); + hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_R2_SENT, &hip_drop_packet, 0); + hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_ESTABLISHED, &hip_drop_packet, 0); + hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_CLOSING, &hip_handle_close_ack, 0); + hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_CLOSED, &hip_handle_close_ack, 0); + hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_NONE, &hip_drop_packet, 0); + +#if 0 +#ifdef CONFIG_HIP_PERFORMANCE + HIP_DEBUG("Start PERF_HANDLE_CLOSE_ACK\n"); + hip_perf_start_benchmark(perf_set, PERF_HANDLE_CLOSE_ACK); + HIP_DEBUG("Stop and write PERF_HANDLE_CLOSE_ACK\n"); + hip_perf_stop_benchmark(perf_set, PERF_HANDLE_CLOSE_ACK); + hip_perf_write_benchmark(perf_set, PERF_HANDLE_CLOSE_ACK); +#endif +#endif + return err; } === modified file 'hipd/input.c' --- hipd/input.c 2010-02-24 15:05:30 +0000 +++ hipd/input.c 2010-02-24 15:12:39 +0000 @@ -615,19 +615,7 @@ break; case HIP_CLOSE: - break; - case HIP_CLOSE_ACK: -#ifdef CONFIG_HIP_PERFORMANCE - HIP_DEBUG("Start PERF_HANDLE_CLOSE_ACK\n"); - hip_perf_start_benchmark(perf_set, PERF_HANDLE_CLOSE_ACK); -#endif - HIP_IFCS(ctx.hadb_entry, err = hip_handle_close_ack(type, state, &ctx)); -#ifdef CONFIG_HIP_PERFORMANCE - HIP_DEBUG("Stop and write PERF_HANDLE_CLOSE_ACK\n"); - hip_perf_stop_benchmark(perf_set, PERF_HANDLE_CLOSE_ACK); - hip_perf_write_benchmark(perf_set, PERF_HANDLE_CLOSE_ACK); -#endif break; default: