From 89c68ad117ff409eb67c9b644499793b4872d15d Mon Sep 17 00:00:00 2001 From: Le Yao Date: Wed, 16 Feb 2022 20:19:08 -0500 Subject: [PATCH] Fix wrong value usage Signed-off-by: Le Yao Change-Id: Ibf59509620bd7d7d62a492ea3b28f5d21e653dee --- platform/cnf-openwrt/src/rest_v1/nat_rest.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/cnf-openwrt/src/rest_v1/nat_rest.lua b/platform/cnf-openwrt/src/rest_v1/nat_rest.lua index 629240c..fb60b9f 100644 --- a/platform/cnf-openwrt/src/rest_v1/nat_rest.lua +++ b/platform/cnf-openwrt/src/rest_v1/nat_rest.lua @@ -50,8 +50,8 @@ function check_nat(value) if value["dest"] == nil then return false, "dest is required for SNAT" end - if dest == "#source" then - dest = ifutil.get_name_by_ip(src_dip) + if value["dest"] == "#source" then + local dest = ifutil.get_name_by_ip(value["src_dip"]) if dest == nil or dest == "" then return false, "428:ip not found on all interfaces" end -- 2.16.6