Committer: Tim Just <tim.just@xxxxxxxxxxxxxx> Date: 25/03/2010 at 17:25:27 Revision: 3716 Revision-id: tim.just@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Branch nick: tiny Log: Renamed the member drop_packet from structure hip_packet_context. drop_packet was replaced with error. The new name is more general. This flag should be used to abort the packet handling. Modified: M hipd/hipd.c M hipd/input.c M hipd/output.c M hipd/pkt_handling.c M lib/core/protodefs.h === modified file 'hipd/hipd.c' --- hipd/hipd.c 2010-03-25 10:47:44 +0000 +++ hipd/hipd.c 2010-03-25 15:24:20 +0000 @@ -306,7 +306,7 @@ packet_ctx.dst_addr = malloc(sizeof(struct in6_addr)); packet_ctx.msg_ports = malloc(sizeof(struct hip_stateless_info)); packet_ctx.hadb_entry = NULL; - packet_ctx.drop_packet = 0; + packet_ctx.error = 0; /* Enter to the select-loop */ HIP_DEBUG_GL(HIP_DEBUG_GROUP_INIT, === modified file 'hipd/input.c' --- hipd/input.c 2010-03-25 10:47:44 +0000 +++ hipd/input.c 2010-03-25 15:24:20 +0000 @@ -957,7 +957,7 @@ * hip_handle_i2_in_i2_sent * * Checks wether the received I2 packet in state I2-SENT should be droppped, or - * not. If the packet should be dropped, the drop_packet flag is set to 1. + * not. If the packet should be dropped, the error flag is set to 1. * * @note See RFC5201, 4.4.2., Table 4 for details. * @@ -978,13 +978,13 @@ { int err = 0; - HIP_IFEL(ctx->drop_packet, + HIP_IFEL(ctx->error, -1, "Abort packet processing.\n"); if (hip_hit_is_bigger(&ctx->hadb_entry->hit_peer, &ctx->hadb_entry->hit_our)) { - ctx->drop_packet = 1; + ctx->error = 1; } out_err: return err; @@ -1037,7 +1037,7 @@ struct sockaddr_storage ss_addr; struct sockaddr *addr = NULL; - HIP_IFEL(ctx->drop_packet, + HIP_IFEL(ctx->error, -1, "Abort packet processing.\n"); @@ -1565,7 +1565,7 @@ free(ctx->hadb_entry->dh_shared_key); } if (err) { - ctx->drop_packet = 1; + ctx->error = 1; } return err; } @@ -1878,28 +1878,28 @@ HIP_DEBUG("Received I1 broadcast\n"); HIP_IFF(src_hit_is_our, -1, - packet_ctx->drop_packet = 1, + packet_ctx->error = 1, "Received a copy of own broadcast, dropping\n"); HIP_IFF(hip_select_source_address(packet_ctx->dst_addr, packet_ctx->src_addr), -1, - packet_ctx->drop_packet = 1, + packet_ctx->error = 1, "Could not find source address\n"); } } else if (IN6_IS_ADDR_MULTICAST(packet_ctx->dst_addr)) { HIP_IFF(src_hit_is_our, -1, - packet_ctx->drop_packet = 1, + packet_ctx->error = 1, "Received a copy of own broadcast, dropping\n"); HIP_IFF(hip_select_source_address(packet_ctx->dst_addr, packet_ctx->src_addr), -1, - packet_ctx->drop_packet = 1, + packet_ctx->error = 1, "Could not find source address\n"); } HIP_IFF(!hip_controls_sane(ntohs(packet_ctx->input_msg->control), mask), -1, - packet_ctx->drop_packet = 1, + packet_ctx->error = 1, "Received illegal controls in I1: 0x%x. Dropping\n", ntohs(packet_ctx->input_msg->control)); === modified file 'hipd/output.c' --- hipd/output.c 2010-03-19 14:29:54 +0000 +++ hipd/output.c 2010-03-25 15:24:20 +0000 @@ -514,7 +514,7 @@ int err = 0, host_id_in_enc_len = 0; uint32_t spi_in = 0; - HIP_IFEL(packet_ctx->drop_packet, + HIP_IFEL(packet_ctx->error, -1, "Abort packet processing.\n"); @@ -1054,7 +1054,7 @@ in_port_t r1_dst_port = 0; uint16_t relay_para_type = 0; - HIP_IFEL(ctx->drop_packet, + HIP_IFEL(ctx->error, -1, "Abort packet processing and don't send R1 packet.\n") @@ -1207,7 +1207,7 @@ int err = 0; uint16_t mask = 0; - HIP_IFEL(packet_ctx->drop_packet, + HIP_IFEL(packet_ctx->error, -1, "Abort packet processing and don't send R1 packet.\n") === modified file 'hipd/pkt_handling.c' --- hipd/pkt_handling.c 2010-03-25 10:47:44 +0000 +++ hipd/pkt_handling.c 2010-03-25 15:24:20 +0000 @@ -146,7 +146,7 @@ while ((iter = hip_ll_iterate(hip_handle_functions[packet_type][ha_state], iter)) - && !ctx->drop_packet) { + && !ctx->error) { ((struct handle_function *) iter->ptr)->func_ptr(packet_type, ha_state, === modified file 'lib/core/protodefs.h' --- lib/core/protodefs.h 2010-03-19 14:29:54 +0000 +++ lib/core/protodefs.h 2010-03-25 15:24:20 +0000 @@ -1059,7 +1059,7 @@ struct in6_addr *dst_addr; struct hip_stateless_info *msg_ports; struct hip_hadb_state *hadb_entry; - uint8_t drop_packet; + uint8_t error; };