nat: fix incorrect using about sw_if_index in nat44-ed static mapping v2 api. 45/37745/3
authorHuawei LI <lihuawei_zzu@163.com>
Sat, 3 Dec 2022 03:30:49 +0000 (11:30 +0800)
committerOle Tr�an <otroan@employees.org>
Mon, 19 Dec 2022 08:07:11 +0000 (08:07 +0000)
Type: fix

Signed-off-by: Huawei LI <lihuawei_zzu@163.com>
Change-Id: I2a96ab0dafe4db796704341c325c43a6960be312

src/plugins/nat/nat44-ed/nat44_ed_api.c

index ea29514..56e2960 100644 (file)
@@ -590,7 +590,7 @@ static void
     }
 
   sw_if_index = clib_net_to_host_u32 (mp->external_sw_if_index);
-  if (sw_if_index)
+  if (sw_if_index != ~0)
     {
       flags |= NAT_SM_FLAG_SWITCH_ADDRESS;
     }