History

openvswitch: Add force commit.

Stateful network admission policy may allow connections to one direction and reject connections initiated in the other direction. After policy change it is possible that for a new connection an overlapping conntrack entry already exists, where the original direction of the existing connection is opposed to the new connection's initial packet. Most importantly, conntrack state relating to the current packet gets the "reply" designation based on whether the original direction tuple or the reply direction tuple matched. If this "directionality" is wrong w.r.t. to the stateful network admission policy it may happen that packets in neither direction are correctly admitted. This patch adds a new "force commit" option to the OVS conntrack action that checks the original direction of an existing conntrack entry. If that direction is opposed to the current packet, the existing conntrack entry is deleted and a new one is subsequently created in the correct direction.

Jarno Rajahalme committed 9 years ago

Commit dd41d331 parent 9dd7f892 files · +29 −2Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/openvswitch.h+5−0
@@ -674,6 +674,10 @@ struct ovs_action_hash { · 673 unmodified lines
674674 * @OVS_CT_ATTR_HELPER: variable length string defining conntrack ALG.
675675 * @OVS_CT_ATTR_NAT: Nested OVS_NAT_ATTR_* for performing L3 network address
676676 * translation (NAT) on the packet.
677+ * @OVS_CT_ATTR_FORCE_COMMIT: Like %OVS_CT_ATTR_COMMIT, but instead of doing
678+ * nothing if the connection is already committed will check that the current
679+ * packet is in conntrack entry's original direction. If directionality does
680+ * not match, will delete the existing conntrack entry and commit a new one.
677681 */
678682 enum ovs_ct_attr {
679683 OVS_CT_ATTR_UNSPEC,
@@ -684,6 +688,7 @@ enum ovs_ct_attr { · 4 unmodified lines
684688 OVS_CT_ATTR_HELPER, /* netlink helper to assist detection of
685689 related connections. */
686690 OVS_CT_ATTR_NAT, /* Nested OVS_NAT_ATTR_* */
691+ OVS_CT_ATTR_FORCE_COMMIT, /* No argument */
687692 __OVS_CT_ATTR_MAX
688693 };
689694