Code review comment for lp:~martin-lp/hipl/update_ack_handling

Revision history for this message
David Martin (martin-lp) wrote :

On Thu, Aug 11, 2011 at 4:22 PM, Diego Biurrun <email address hidden> wrote:
> review needs-fixing
>
> On Thu, Aug 11, 2011 at 01:46:52PM +0000, David Martin wrote:
>>
>> --- modules/update/hipd/update.c 2011-07-18 16:41:13 +0000
>> +++ modules/update/hipd/update.c 2011-08-11 13:46:45 +0000
>> @@ -157,6 +158,46 @@

> Geez, this is complicated.

I know I know, but there does not seem to be much you can do about it.

> Luckily some of it is redundant, witness:
>
> if (state->update_id_out_lower_bound <= hip_update_get_out_id(state)) {
> if (ack_peer_update_id >= state->update_id_out_lower_bound &&
> ack_peer_update_id <= hip_update_get_out_id(state)) {
> state->update_id_out_lower_bound = ack_peer_update_id;
> return true;
> } else {
> if (ack_peer_update_id >= state->update_id_out_lower_bound ||
> ack_peer_update_id <= hip_update_get_out_id(state)) {
> state->update_id_out_lower_bound = ack_peer_update_id;
> return true;
> }
> return false;

Hah, you are awesome! Fixed it.

« Back to merge proposal