------------------------------------------------------------ revno: 5973 committer: Rene Hummen <rene.hummen@xxxxxxxxxxxxxxxxx> branch nick: trunk timestamp: Fri 2011-06-24 15:50:27 +0200 message: fix regression in esp_tuple_from_esp_info() The conditional depended on new_esp instead of esp_info and the function always returned NULL to the caller signaling an error. modified: firewall/conntrack.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 'firewall/conntrack.c' --- firewall/conntrack.c 2011-05-03 11:28:22 +0000 +++ firewall/conntrack.c 2011-06-24 13:50:27 +0000 @@ -888,15 +888,17 @@ HIP_ASSERT(tuple); struct esp_tuple *const new_esp = calloc(1, sizeof(*new_esp)); - if (new_esp) { + if (esp_info) { new_esp->spi = ntohl(esp_info->new_spi); new_esp->tuple = tuple; hip_ll_init(&new_esp->dst_addresses); update_esp_address(new_esp, addr, NULL); - } else { - HIP_ERROR("Allocating esp_tuple object failed"); + + return new_esp; } + + HIP_ERROR("Allocating esp_tuple object failed"); free(new_esp); return NULL;