diff options
author | Filip Varga <fivarga@cisco.com> | 2021-10-21 14:27:43 +0200 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2021-11-11 12:40:30 +0000 |
commit | 730c1a40978a321b0788c3240db1c32274937249 (patch) | |
tree | 486058867ba80681982ae9f0fa4245288b9daf1c /src/plugins/nat/nat44-ei/nat44_ei.h | |
parent | aa63bc6cf4b9031c3fc6ae22aecd846cc712bc52 (diff) |
nat: nat44-ei/ed nat objects cleanup improvements
Improvements:
* Changed plugin disable call behavior from freeing data types
to calling appropriate nat plugin object delete calls for
pool addresses, mappings and interfaces.
* Added wrapper nat44_ei/ed_add_del_static_mapping function to
handle switch bound static mappings. This would also fix ip assignment
callback add/del bound static mapping issue preventing creation of the
mapping.
Fixes:
* Fixed lingering object issue: some nat intertwined objects would
not free each other if not correctly deleted in proper order.
* Fixed incorect order of FIB unlocks for pool addresses causing
syslog messages to use deleted FIBs in multiple VRF configuration.
* Fixed incorrect value testing of flags instead of vrf_id for
multiple vrf configuration static mapping.
Type: improvement
Change-Id: I2743f7b1104b627bcc5ef937e3a50655313a26ea
Signed-off-by: Filip Varga <fivarga@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat44-ei/nat44_ei.h')
-rw-r--r-- | src/plugins/nat/nat44-ei/nat44_ei.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/nat/nat44-ei/nat44_ei.h b/src/plugins/nat/nat44-ei/nat44_ei.h index 5f42b834094..b8b339b8e89 100644 --- a/src/plugins/nat/nat44-ei/nat44_ei.h +++ b/src/plugins/nat/nat44-ei/nat44_ei.h @@ -63,8 +63,9 @@ typedef enum #define NAT44_EI_SESSION_FLAG_UNKNOWN_PROTO (1 << 1) /* Static mapping flags */ -#define NAT44_EI_SM_FLAG_ADDR_ONLY (1 << 0) -#define NAT44_EI_SM_FLAG_IDENTITY_NAT (1 << 1) +#define NAT44_EI_SM_FLAG_ADDR_ONLY (1 << 0) +#define NAT44_EI_SM_FLAG_IDENTITY_NAT (1 << 1) +#define NAT44_EI_SM_FLAG_SWITCH_ADDRESS (1 << 2) typedef struct { @@ -678,6 +679,12 @@ is_sm_identity_nat (u32 f) return (f & NAT44_EI_SM_FLAG_IDENTITY_NAT); } +always_inline bool +is_sm_switch_address (u32 f) +{ + return (f & NAT44_EI_SM_FLAG_SWITCH_ADDRESS); +} + /* logging */ #define nat44_ei_log_err(...) \ vlib_log (VLIB_LOG_LEVEL_ERR, nat44_ei_main.log_class, __VA_ARGS__) |