If the key is zero, it doesn't mean we don't need to match on it.
Masks should be checked instead.

Fixes: 49a7961fca65 ("lib/tc: Avoid matching on tunnel ttl or tos if not 
needed")
Reviewed-by: Roi Dayan <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
---
 lib/netdev-offload-tc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
index 74aefef68..1ab12ecfe 100644
--- a/lib/netdev-offload-tc.c
+++ b/lib/netdev-offload-tc.c
@@ -1117,15 +1117,15 @@ parse_tc_flower_to_match(struct tc_flower *flower,
                                           &flower->key.tunnel.ipv6.ipv6_src,
                                           &flower->mask.tunnel.ipv6.ipv6_src);
         }
-        if (flower->key.tunnel.tos) {
+        if (flower->mask.tunnel.tos) {
             match_set_tun_tos_masked(match, flower->key.tunnel.tos,
                                      flower->mask.tunnel.tos);
         }
-        if (flower->key.tunnel.ttl) {
+        if (flower->mask.tunnel.ttl) {
             match_set_tun_ttl_masked(match, flower->key.tunnel.ttl,
                                      flower->mask.tunnel.ttl);
         }
-        if (flower->key.tunnel.tp_dst) {
+        if (flower->mask.tunnel.tp_dst) {
             match_set_tun_tp_dst_masked(match, flower->key.tunnel.tp_dst,
                                         flower->mask.tunnel.tp_dst);
         }
-- 
2.34.3

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

Reply via email to