Committer: Miika Komu <miika@xxxxxx> Date: Thu Mar 11 14:43:03 2010 +0200 Revision: 3925 Revision-id: miika@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Branch nick: trunk Log: Fixed two uninitialization problems * SP/SAs were not flushed because hadb was erased too early * Opportunistic database was erased twice (see bug id 1251) Modified: M hipd/init.c M hipd/oppdb.c === modified file 'hipd/init.c' --- hipd/init.c 2010-03-11 11:12:11 +0000 +++ hipd/init.c 2010-03-11 12:43:03 +0000 @@ -1099,6 +1099,9 @@ close(hip_nat_sock_output_udp_v6); } + hip_uninit_hadb(); + hip_uninit_host_id_dbs(); + if (hip_user_sock) { HIP_INFO("hip_user_sock\n"); close(hip_user_sock); @@ -1112,9 +1115,6 @@ rtnl_close(&hip_nl_route); } - hip_uninit_hadb(); - hip_uninit_host_id_dbs(); - msg = hip_msg_alloc(); if (msg) { hip_build_user_hdr(msg, SO_HIP_DAEMON_QUIT, 0); === modified file 'hipd/oppdb.c' --- hipd/oppdb.c 2010-03-10 17:44:36 +0000 +++ hipd/oppdb.c 2010-03-11 12:43:03 +0000 @@ -134,6 +134,7 @@ { hip_for_each_opp(hip_oppdb_uninit_wrap, NULL); hip_ht_uninit(oppdb); + oppdb = NULL; } static int hip_opp_unblock_app(const struct sockaddr_in6 *app_id, hip_opp_info_t *opp_info, @@ -840,6 +841,9 @@ hip_opp_block_t *this, *ret = NULL; hip_list_t *item, *tmp; + if (oppdb == NULL) + return NULL; + HIP_LOCK_HT(&opp_db); list_for_each_safe(item, tmp, oppdb, i) {