diff options
author | Eelco Chaudron <echaudro@redhat.com> | 2022-02-22 16:25:28 +0100 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2022-03-21 00:42:38 +0100 |
commit | d5a2b05e31e6278f5eac0a463f81233f45fecdb4 (patch) | |
tree | f85d72130e507bf234f813d90a6076b7b567c4c2 | |
parent | c0b51d66cb9a30df1f9f534ee2773e542bc22b67 (diff) | |
download | openvswitch-d5a2b05e31e6278f5eac0a463f81233f45fecdb4.tar.gz |
netdev-offload-tc: Fix IP and port ranges in flower returns.
When programming NAT rules OVS only sets the minimum value for a
single IP/port value. However, responses from flower will always
return min == max for single IP/port values. This is causing the
verification to fail as the request is different than the response.
To avoid this, we will update the response to match the request.
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r-- | lib/tc.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1363,7 +1363,9 @@ nl_parse_act_ct(struct nlattr *options, struct tc_flower *flower) if (ipv4_max) { ovs_be32 addr = nl_attr_get_be32(ipv4_max); - action->ct.range.ipv4.max = addr; + if (action->ct.range.ipv4.min != addr) { + action->ct.range.ipv4.max = addr; + } } } else if (ipv6_min) { action->ct.range.ip_family = AF_INET6; @@ -1372,7 +1374,9 @@ nl_parse_act_ct(struct nlattr *options, struct tc_flower *flower) if (ipv6_max) { struct in6_addr addr = nl_attr_get_in6_addr(ipv6_max); - action->ct.range.ipv6.max = addr; + if (!ipv6_addr_equals(&action->ct.range.ipv6.min, &addr)) { + action->ct.range.ipv6.max = addr; + } } } @@ -1380,6 +1384,10 @@ nl_parse_act_ct(struct nlattr *options, struct tc_flower *flower) action->ct.range.port.min = nl_attr_get_be16(port_min); if (port_max) { action->ct.range.port.max = nl_attr_get_be16(port_max); + if (action->ct.range.port.min == + action->ct.range.port.max) { + action->ct.range.port.max = 0; + } } } } |