From 99511463ce11259b784d50da250631583ee74a6f Mon Sep 17 00:00:00 2001 From: Ruoyu Date: Thu, 5 Aug 2021 10:58:52 +0800 Subject: [PATCH] Fix number of issues - Change dependency rules set for hub-device connection - Fix 'type' issue in ipsec.lua - First change the updown script to create concrete vti tunnels Change-Id: Iab381c4768240cebcf5eaff5d221349304c7bbaa Signed-off-by: Ruoyu --- central-controller/src/scc/api/api.go | 1 - platform/cnf-openwrt/src/rest_v1/ipsec_rest.lua | 2 +- platform/cnf-openwrt/src/updown | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/central-controller/src/scc/api/api.go b/central-controller/src/scc/api/api.go index 08604f2..648669f 100644 --- a/central-controller/src/scc/api/api.go +++ b/central-controller/src/scc/api/api.go @@ -182,7 +182,6 @@ func NewRouter( ipRangeObjectClient.AddDepResManager(overlayObjectClient) certificateObjectClient.AddDepResManager(overlayObjectClient) hubDeviceObjectClient.AddDepResManager(hubObjectClient) - hubDeviceObjectClient.AddDepResManager(deviceObjectClient) hubConnObjectClient.AddDepResManager(hubObjectClient) deviceConnObjectClient.AddDepResManager(deviceObjectClient) hubCNFObjectClient.AddDepResManager(hubObjectClient) diff --git a/platform/cnf-openwrt/src/rest_v1/ipsec_rest.lua b/platform/cnf-openwrt/src/rest_v1/ipsec_rest.lua index 2f0be5e..75ce2cc 100644 --- a/platform/cnf-openwrt/src/rest_v1/ipsec_rest.lua +++ b/platform/cnf-openwrt/src/rest_v1/ipsec_rest.lua @@ -140,7 +140,7 @@ function is_vti_enabled(value) end uci:save(uci_conf) uci:commit(uci_conf) - return true, value + return true, mode end function save_cert(content, path) diff --git a/platform/cnf-openwrt/src/updown b/platform/cnf-openwrt/src/updown index 85dde1f..fe4500e 100755 --- a/platform/cnf-openwrt/src/updown +++ b/platform/cnf-openwrt/src/updown @@ -12,8 +12,8 @@ VTI_IF="vti_${NET_IF}" case "${PLUTO_VERB}" in up-host) - #ip tunnel add "${VTI_IF}" local "${PLUTO_ME}" remote "${PLUTO_PEER}" mode vti \ - ip tunnel add "${VTI_IF}" local "${PLUTO_ME}" remote 0.0.0.0 mode vti \ + #ip tunnel add "${VTI_IF}" local "${PLUTO_ME}" remote 0.0.0.0 mode vti \ + ip tunnel add "${VTI_IF}" local "${PLUTO_ME}" remote "${PLUTO_PEER}" mode vti \ key "${PLUTO_MARK_OUT%%/*}" ip link set "${VTI_IF}" up ip route add "${PLUTO_PEER_SOURCEIP}" dev "${VTI_IF}" src "${PLUTO_ME}" -- 2.16.6