summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2021-02-02 13:25:40 +0100
committerOle Tr�an <otroan@employees.org>2021-02-10 13:12:33 +0000
commit98d82ca04ba438cd2ba3c03de6e1e82e4786cd83 (patch)
treed63d0b002555b63730fab3cea261d824c21986b1 /src/vnet
parent4f423bf6b4f3dedf6a3e8d5bbb38c31558d13534 (diff)
nat: fix EI hairpinning thread safety
Avoid doing inter-thread reads without locks by doing a handoff before destination address rewrite. Destination address is read from a session which is possibly owned by a different thread. By splitting the work in two parts with a handoff in the middle, we can do both in a thread safe way. Type: improvement Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I1c50d188393a610f5564fa230c75771a8065f273
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/buffer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/vnet/buffer.h b/src/vnet/buffer.h
index aae999620ac..88637e1d902 100644
--- a/src/vnet/buffer.h
+++ b/src/vnet/buffer.h
@@ -378,6 +378,7 @@ typedef struct
struct
{
u32 flags;
+ u32 required_thread_index;
} snat;
u32 unused[6];