On 8/8/24 11:53, Ales Musil wrote:
> The logic would return true if there was at least one discovered feature.
> However, that wasn't the purpose of that function. Fix the logic,
> so it returns true only if all features are discovered.
> 
> Fixes: bc94def2dacf ("features: Make querying of OpenFlow features more 
> versatile.")
> Signed-off-by: Ales Musil <[email protected]>
> ---
>  lib/features.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/features.c b/lib/features.c
> index ab0327d51..98d56602c 100644
> --- a/lib/features.c
> +++ b/lib/features.c
> @@ -457,10 +457,10 @@ ovs_feature_set_discovered(void)
>  {
>      /* The supported feature set has been discovered if we're connected
>       * to OVS and it replied to all our feature request messages. */
> -    bool replied_to_all = false;
> +    bool replied_to_all = true;
>      for (size_t i = 0; i < ARRAY_SIZE(all_openflow_features); i++) {
>          struct ovs_openflow_feature *feature = &all_openflow_features[i];
> -        replied_to_all |= !feature->queued;
> +        replied_to_all &= !feature->queued;
>      }
>  
>      return swconn && rconn_is_connected(swconn) && replied_to_all;

Nice catch!  Looks good to me, thanks!

Acked-by: Dumitru Ceara <[email protected]>

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to