nat: fix crash when translate unknown proto packets 67/32467/2
authorAlexander Chernavin <achernavin@netgate.com>
Thu, 27 May 2021 14:05:17 +0000 (10:05 -0400)
committerOle Tr�an <otroan@employees.org>
Wed, 16 Jun 2021 07:58:17 +0000 (07:58 +0000)
commitb862f1dd52b0f5318d67b4463be90562e57f8278
tree9443bc60f9bcc48de62a778843ea54662c94e0eb
parent26c6fffa7ac30bda79432a6d46d6dd5d286b7cb6
nat: fix crash when translate unknown proto packets

Type: fix

Currently, there might be a crash in NAT ED mode:
 * if a session for an unknown proto packet cannot be created in2out,
 * if a session for an unknown proto packet cannot be found out2in.

With this change, translate packets only if a session is given in NAT
ED mode.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Iafb332db1ae9a3e76435964ad636037d1b8a51e8
src/plugins/nat/nat44-ed/nat44_ed_in2out.c
src/plugins/nat/nat44-ed/nat44_ed_out2in.c