Merge "[rdkb][common][app][Fix 2024q1 version build fail issue]"
diff --git a/recipes-ccsp/ccsp/ccsp-eth-agent.bbappend b/recipes-ccsp/ccsp/ccsp-eth-agent.bbappend
index a7ec1c0..3244638 100644
--- a/recipes-ccsp/ccsp/ccsp-eth-agent.bbappend
+++ b/recipes-ccsp/ccsp/ccsp-eth-agent.bbappend
@@ -1,5 +1,21 @@
 require ccsp_common_filogic.inc
 
+FILESEXTRAPATHS_append := "${THISDIR}/files:"
+
+SRC_URI_append += " \
+    file://Fix-ccsp-eth-agent-build-error.patch;apply=no \
+"
+
+do_filogic_patches() {
+    cd ${S}
+
+    if [ ! -e filogic_patch_applied ] && [[ "${PROJECT_BRANCH}" == "rdkb-2024q1-dunfell" || "${PROJECT_BRANCH}" == "rdkb-2024q1-kirkstone" ]]; then
+        patch -p1 < ${WORKDIR}/Fix-ccsp-eth-agent-build-error.patch
+        touch filogic_patch_applied
+    fi
+}
+addtask filogic_patches after do_unpack before do_configure
+
 CFLAGS_aarch64_append = " -Werror=format-truncation=1 "
 
 EXTRA_OECONF_append_dunfell  = " --with-ccsp-arch=arm"
@@ -8,4 +24,4 @@
     -lsyscfg \
     -lbreakpadwrapper \
 "
-LDFLAGS_append_dunfell = " -lpthread -lsafec-3.5.1"
+LDFLAGS_append_dunfell = " -lpthread -lsafec-3.5.1"
\ No newline at end of file
diff --git a/recipes-ccsp/ccsp/files/Fix-ccsp-eth-agent-build-error.patch b/recipes-ccsp/ccsp/files/Fix-ccsp-eth-agent-build-error.patch
new file mode 100644
index 0000000..9b562e6
--- /dev/null
+++ b/recipes-ccsp/ccsp/files/Fix-ccsp-eth-agent-build-error.patch
@@ -0,0 +1,27 @@
+From de1631bd9636e579cce830022a97f6232e2c217e Mon Sep 17 00:00:00 2001
+From: Allen Ye <allen.ye@mediatek.com>
+Date: Wed, 31 Jan 2024 10:27:09 +0800
+Subject: [PATCH] Fix build error
+
+---
+ source/TR-181/board_sbapi/cosa_ethernet_apis.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/source/TR-181/board_sbapi/cosa_ethernet_apis.c b/source/TR-181/board_sbapi/cosa_ethernet_apis.c
+index efa3c57..cc66856 100644
+--- a/source/TR-181/board_sbapi/cosa_ethernet_apis.c
++++ b/source/TR-181/board_sbapi/cosa_ethernet_apis.c
+@@ -1539,8 +1539,8 @@ ANSC_STATUS CosaDmlIfaceFinalize(char *pValue, BOOL isAutoWanMode)
+     else
+     {
+         char acSetParamName[256];
+-        char acTmpCableValue[32] = {0};
+-        char acTmpEthValue[32] = {0};
++        char acTmpCableValue[64] = {0};
++        char acTmpEthValue[64] = {0};
+         if (ethwanEnabled == TRUE)
+         {
+             snprintf(acTmpCableValue, sizeof(acTmpCableValue), "%s", ETHWAN_DOCSIS_INF_NAME);
+-- 
+2.18.0
+