mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-07-01 23:53:16 -04:00
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. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Pravin B Shelar <pshelar@ovn.org> Acked-by: Joe Stringer <joe@ovn.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
9dd7f8907c
commit
dd41d33f0b
2 changed files with 29 additions and 2 deletions
|
@ -674,6 +674,10 @@ struct ovs_action_hash {
|
|||
* @OVS_CT_ATTR_HELPER: variable length string defining conntrack ALG.
|
||||
* @OVS_CT_ATTR_NAT: Nested OVS_NAT_ATTR_* for performing L3 network address
|
||||
* translation (NAT) on the packet.
|
||||
* @OVS_CT_ATTR_FORCE_COMMIT: Like %OVS_CT_ATTR_COMMIT, but instead of doing
|
||||
* nothing if the connection is already committed will check that the current
|
||||
* packet is in conntrack entry's original direction. If directionality does
|
||||
* not match, will delete the existing conntrack entry and commit a new one.
|
||||
*/
|
||||
enum ovs_ct_attr {
|
||||
OVS_CT_ATTR_UNSPEC,
|
||||
|
@ -684,6 +688,7 @@ enum ovs_ct_attr {
|
|||
OVS_CT_ATTR_HELPER, /* netlink helper to assist detection of
|
||||
related connections. */
|
||||
OVS_CT_ATTR_NAT, /* Nested OVS_NAT_ATTR_* */
|
||||
OVS_CT_ATTR_FORCE_COMMIT, /* No argument */
|
||||
__OVS_CT_ATTR_MAX
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue