flow_offload: fix allowed types check
authorJiri Pirko <jiri@resnulli.us>
Tue, 10 Mar 2020 15:49:07 +0000 (16:49 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 10 Mar 2020 23:04:19 +0000 (16:04 -0700)
Change the check to see if the passed allowed type bit is enabled.

Fixes: 319a1d19471e ("flow_offload: check for basic action hw stats type")
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/flow_offload.h

index 891e1505570887cdb109bb972226e7d43192fc0c..2fda4178ba3548f48bc03a86d7ec301423613016 100644 (file)
@@ -306,7 +306,7 @@ flow_action_hw_stats_types_check(const struct flow_action *action,
                NL_SET_ERR_MSG_MOD(extack, "Driver supports only default HW stats type \"any\"");
                return false;
        } else if (allowed_hw_stats_type != 0 &&
-                  action_entry->hw_stats_type != allowed_hw_stats_type) {
+                  !(action_entry->hw_stats_type & allowed_hw_stats_type)) {
                NL_SET_ERR_MSG_MOD(extack, "Driver does not support selected HW stats type");
                return false;
        }