diff options
author | Darrell Ball <dlu998@gmail.com> | 2017-06-13 07:46:29 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2017-06-13 12:42:36 -0700 |
commit | adafc876939525ef1ce1474096d51f5401e5a86f (patch) | |
tree | 9fecd9b6798b03e9ff9044cbd8a92ef59cf36d0b | |
parent | c1c7480b352d832d9fc469397db47d8c7d4c6d37 (diff) | |
download | openvswitch-adafc876939525ef1ce1474096d51f5401e5a86f.tar.gz |
conntrack: Reset nat_info in un_nat conns.
Un-nat conns have no nat_info as do default conns.
However, un-nat conns are originally templated from the
corresponding default conns and therefore need to
have their nat_info explicitly nulled. This
otherwise exposes a double free if conntrack_destroy()
were to be used to destroy the connection tracker. This
would apply to cleaning the datapath after testing.
Fixes: 286de2729955 ("dpdk: Userspace Datapath: Introduce NAT Support.")
Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Greg Rose <gvrose8192@gmail.com>
-rw-r--r-- | lib/conntrack.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/conntrack.c b/lib/conntrack.c index 146edd700..90b154a87 100644 --- a/lib/conntrack.c +++ b/lib/conntrack.c @@ -573,6 +573,7 @@ conn_not_found(struct conntrack *ct, struct dp_packet *pkt, nc->conn_type == CT_CONN_TYPE_DEFAULT) { *nc = *conn_for_un_nat_copy; conn_for_un_nat_copy->conn_type = CT_CONN_TYPE_UN_NAT; + conn_for_un_nat_copy->nat_info = NULL; } ct_rwlock_unlock(&ct->nat_resources_lock); |