2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-17 14:28:02 +00:00

ofproto-dpif: Detect support for ct_tuple6.

Support for extracting original direction 5 tuple fields from the
connection tracking module may differ on some platforms between the IPv4
original tuple fields vs. IPv6. Detect IPv6 original tuple support
separately and reflect this support up to the OpenFlow layer.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Joe Stringer
2017-06-02 09:38:47 -07:00
parent b31f1b0482
commit 7b5bbe5d65
3 changed files with 26 additions and 13 deletions

View File

@@ -4497,8 +4497,9 @@ odp_flow_key_from_flow__(const struct odp_flow_key_parms *parms,
nl_msg_put_unspec(buf, OVS_KEY_ATTR_CT_LABELS, &data->ct_label,
sizeof(data->ct_label));
}
if (parms->support.ct_orig_tuple && flow->ct_nw_proto) {
if (flow->dl_type == htons(ETH_TYPE_IP)) {
if (flow->ct_nw_proto) {
if (parms->support.ct_orig_tuple
&& flow->dl_type == htons(ETH_TYPE_IP)) {
struct ovs_key_ct_tuple_ipv4 ct = {
data->ct_nw_src,
data->ct_nw_dst,
@@ -4508,7 +4509,8 @@ odp_flow_key_from_flow__(const struct odp_flow_key_parms *parms,
};
nl_msg_put_unspec(buf, OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV4, &ct,
sizeof ct);
} else if (flow->dl_type == htons(ETH_TYPE_IPV6)) {
} else if (parms->support.ct_orig_tuple6
&& flow->dl_type == htons(ETH_TYPE_IPV6)) {
struct ovs_key_ct_tuple_ipv6 ct = {
data->ct_ipv6_src,
data->ct_ipv6_dst,