Use a newer commit ID of ONL compatible with BAL3.5 and beyond for Edgecore devices.
Also apply PR in ONL for memory leaks on ACCTON devices. The PR is not merged yet
officially by the ONL project maintainers but Edgecore recommends this patch to be
applied.

Change-Id: I5aca53fc87a54b7e2f425a786c27f4f5368f25e5
diff --git a/VERSION b/VERSION
index 51dd6ab..9575d51 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.6.1-dev
+3.6.1
diff --git a/agent/Makefile.in b/agent/Makefile.in
index 668fcbb..6fece0f 100644
--- a/agent/Makefile.in
+++ b/agent/Makefile.in
@@ -360,6 +360,7 @@
 	if [ "$(ONL_COMMIT_ID)" = "$(INBAND_PATCH_COMMIT_ID)" ]; then \
 	    echo "ONL commit and inband patch commit matched."; \
 	    cp $(TOP_DIR)/inband/patch/*.patch $(ONL_DIR)/OpenNetworkLinux; \
+	    cp $(TOP_DIR)/download/disable-certificate-validation-v*.patch $(ONL_DIR)/OpenNetworkLinux; \
 	else \
 	    echo "ONL commit and inband patch commit does not match. Exiting."; \
 	    exit 1; \
diff --git a/agent/download/Makefile.onl b/agent/download/Makefile.onl
index 5fdf412..5fd51a6 100644
--- a/agent/download/Makefile.onl
+++ b/agent/download/Makefile.onl
@@ -12,15 +12,15 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-COMMIT_ID = 72b95a7
+COMMIT_ID = f0bcb230
 INBAND = "n"
 BOARD = ""
 
 onl-4.14:
 	if [ $(INBAND) = y ]; then \
-	    cd OpenNetworkLinux && git checkout -B $@ $(COMMIT_ID) && git apply disable-certificate-validation-v$(COMMIT_ID).patch && git apply inband-$(COMMIT_ID).patch && docker/tools/onlbuilder --non-interactive -8 -c ./build-onl.sh; \
+	    cd OpenNetworkLinux && git checkout -B $@ $(COMMIT_ID) && git pull origin pull/822/head -ff -q --no-edit && git apply disable-certificate-validation-v$(COMMIT_ID).patch && git apply inband-$(COMMIT_ID).patch && docker/tools/onlbuilder --non-interactive -8 -c ./build-onl.sh; \
 	else \
-	cd OpenNetworkLinux && git stash && git checkout -B $@ $(COMMIT_ID) && git apply disable-certificate-validation-v$(COMMIT_ID).patch && docker/tools/onlbuilder --non-interactive -8 -c ./build-onl.sh; \
+	cd OpenNetworkLinux && git stash && git checkout -B $@ $(COMMIT_ID) && git pull origin pull/822/head -ff -q --no-edit && git apply disable-certificate-validation-v$(COMMIT_ID).patch && docker/tools/onlbuilder --non-interactive -8 -c ./build-onl.sh; \
 	fi;
 onl-4.19:
 	if [ "$(BOARD)" = "rlt-3200g-w" ]; then \
diff --git a/agent/download/disable-certificate-validation-v72b95a7.patch b/agent/download/disable-certificate-validation-vf0bcb230.patch
similarity index 91%
rename from agent/download/disable-certificate-validation-v72b95a7.patch
rename to agent/download/disable-certificate-validation-vf0bcb230.patch
index f4a073e..a0e842f 100644
--- a/agent/download/disable-certificate-validation-v72b95a7.patch
+++ b/agent/download/disable-certificate-validation-vf0bcb230.patch
@@ -1,5 +1,5 @@
 diff --git a/make/kbuild.mk b/make/kbuild.mk
-index 8be2961b..f5048c5b 100644
+index 06d39e2f..8ce74bc4 100644
 --- a/make/kbuild.mk
 +++ b/make/kbuild.mk
 @@ -114,7 +114,7 @@ K_DTBS_DIR := $(K_SOURCE_DIR)-dtbs
diff --git a/agent/inband/patch/inband-72b95a7.patch b/agent/inband/patch/inband-f0bcb230.patch
similarity index 100%
rename from agent/inband/patch/inband-72b95a7.patch
rename to agent/inband/patch/inband-f0bcb230.patch