summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorJoe Stringer <joe@ovn.org>2017-06-02 09:38:47 -0700
committerJoe Stringer <joe@ovn.org>2017-07-14 11:22:35 -0700
commit7b5bbe5d650da8f6741e9228e37c9e3b11986cac (patch)
treeac2c4a48941c2c4bb4f8297e0e5ccad46574d361 /ofproto
parentb31f1b0482b9440bb6b47bfed1465a5112a66e10 (diff)
downloadopenvswitch-7b5bbe5d650da8f6741e9228e37c9e3b11986cac.tar.gz
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>
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto-dpif.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index d19d486d9..7cf1a4027 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -1357,6 +1357,7 @@ CHECK_FEATURE__(ct_label, ct_label, ct_label.u64.lo, 1, ETH_TYPE_IP)
CHECK_FEATURE__(ct_state_nat, ct_state, ct_state, \
CS_TRACKED|CS_SRC_NAT, ETH_TYPE_IP)
CHECK_FEATURE__(ct_orig_tuple, ct_orig_tuple, ct_nw_proto, 1, ETH_TYPE_IP)
+CHECK_FEATURE__(ct_orig_tuple6, ct_orig_tuple6, ct_nw_proto, 1, ETH_TYPE_IPV6)
#undef CHECK_FEATURE
#undef CHECK_FEATURE__
@@ -1387,6 +1388,7 @@ check_support(struct dpif_backer *backer)
backer->support.odp.ct_state_nat = check_ct_state_nat(backer);
backer->support.odp.ct_orig_tuple = check_ct_orig_tuple(backer);
+ backer->support.odp.ct_orig_tuple6 = check_ct_orig_tuple6(backer);
}
static int
@@ -4264,7 +4266,7 @@ check_mask(struct ofproto_dpif *ofproto, const struct miniflow *flow)
* the features we know of. */
if (support->ct_state && support->ct_zone && support->ct_mark
&& support->ct_label && support->ct_state_nat
- && support->ct_orig_tuple) {
+ && support->ct_orig_tuple && support->ct_orig_tuple6) {
return ct_state & CS_UNSUPPORTED_MASK ? OFPERR_OFPBMC_BAD_MASK : 0;
}
@@ -4281,14 +4283,22 @@ check_mask(struct ofproto_dpif *ofproto, const struct miniflow *flow)
return OFPERR_OFPBMC_BAD_MASK;
}
- if (!support->ct_orig_tuple &&
- (MINIFLOW_GET_U8(flow, ct_nw_proto) ||
- MINIFLOW_GET_U16(flow, ct_tp_src) ||
- MINIFLOW_GET_U16(flow, ct_tp_dst) ||
- MINIFLOW_GET_U32(flow, ct_nw_src) ||
- MINIFLOW_GET_U32(flow, ct_nw_dst) ||
- !ovs_u128_is_zero(MINIFLOW_GET_U128(flow, ct_ipv6_src)) ||
- !ovs_u128_is_zero(MINIFLOW_GET_U128(flow, ct_ipv6_dst)))) {
+ if (!support->ct_orig_tuple && !support->ct_orig_tuple6
+ && (MINIFLOW_GET_U8(flow, ct_nw_proto)
+ || MINIFLOW_GET_U16(flow, ct_tp_src)
+ || MINIFLOW_GET_U16(flow, ct_tp_dst))) {
+ return OFPERR_OFPBMC_BAD_MASK;
+ }
+
+ if (!support->ct_orig_tuple
+ && (MINIFLOW_GET_U32(flow, ct_nw_src)
+ || MINIFLOW_GET_U32(flow, ct_nw_dst))) {
+ return OFPERR_OFPBMC_BAD_MASK;
+ }
+
+ if (!support->ct_orig_tuple6
+ && (!ovs_u128_is_zero(MINIFLOW_GET_U128(flow, ct_ipv6_src))
+ || !ovs_u128_is_zero(MINIFLOW_GET_U128(flow, ct_ipv6_dst)))) {
return OFPERR_OFPBMC_BAD_MASK;
}