[PATCH] ieee802_1x_kay.c: Removed continue statement from bottom of for loop

Jouni Malinen j at w1.fi
Sat Dec 10 09:15:45 PST 2016


On Thu, Dec 08, 2016 at 04:30:59PM +0530, Nishant Chaprana wrote:
> continue statement at bottom of for loop is not required,
> so removed continue statement from bottom of for loop.

While the continue statement here does not really make any difference,
I'm not sure removing it is the correct fix or cleanup here.

> diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c
> @@ -1094,7 +1094,6 @@ ieee802_1x_mka_decode_potential_peer_body(
>  			if (peer_mn > participant->mn &&
>  			    !reset_participant_mi(participant))
>  				wpa_printf(MSG_DEBUG, "KaY: Could not update mi");
> -			continue;
>  		}
>  	}

Should that instead break the loop on finding a match (the "it is
myself" check just before this context)? Or is this continue here to
maintain consistent style with other similar functions that actually
continue processing like ieee802_1x_mka_decode_live_peer_body()?

Unless there is better understanding and more justification for removing
the "unnecessary" continue statement, I think I'd rather leave it here
to remain consistent with the other functions and to be more future
proof if something get added to the end of this loop.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list