From 90648b1536d8d4252871b91db9faa4ba707c2b8d Mon Sep 17 00:00:00 2001
From: Rohan Sahay <Rohan.Sahay@silabs.com>
Date: Thu, 8 Sep 2022 15:14:02 +0000
Subject: [PATCH] Pull request #81: Revert "Pull request #69: Adds support for
 IPv4 by default"

Merge in WMN_TOOLS/matter from feature/disable-default-ipv4-flag to RC_0.3.0

Squashed commit of the following:

commit 4e96708b536cbd62f57c727fdcc973d749af80c6
Author: rosahay-silabs <Rohan.Sahay@silabs.com>
Date:   Thu Sep 8 18:54:58 2022 +0530

    Revert "Pull request #69: Adds support for IPv4 by default"

    This reverts commit 56d941d1adb73dc7a04046c70e6a9a13431ddd1e.
---
 examples/light-switch-app/efr32/BUILD.gn |  2 +-
 examples/lighting-app/efr32/BUILD.gn     |  2 +-
 examples/lock-app/efr32/BUILD.gn         |  2 +-
 examples/thermostat/efr32/BUILD.gn       | 10 +++++-----
 examples/window-app/efr32/BUILD.gn       |  2 +-
 scripts/examples/gn_efr32_example.sh     |  4 ++++
 6 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/examples/light-switch-app/efr32/BUILD.gn b/examples/light-switch-app/efr32/BUILD.gn
index bae931e42345fb..07bcfe6c204e7f 100644
--- a/examples/light-switch-app/efr32/BUILD.gn
+++ b/examples/light-switch-app/efr32/BUILD.gn
@@ -62,7 +62,7 @@ declare_args() {
   disable_lcd = false
 
   # Argument to Disable IPv4 for wifi(rs911)
-  chip_enable_wifi_ipv4 = true
+  chip_enable_wifi_ipv4 = false
 
   # Argument to force enable WPA3 security
   rs91x_wpa3_only = false
diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn
index 30c6ea7a441b58..4db2f6a8f1afeb 100644
--- a/examples/lighting-app/efr32/BUILD.gn
+++ b/examples/lighting-app/efr32/BUILD.gn
@@ -62,7 +62,7 @@ declare_args() {
   disable_lcd = false
 
   # Argument to Disable IPv4 for wifi(rs911)
-  chip_enable_wifi_ipv4 = true
+  chip_enable_wifi_ipv4 = false
 
   # Argument to force enable WPA3 security on rs91x
   rs91x_wpa3_only = false
diff --git a/examples/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn
index 813508abdca6b9..52862d739841f1 100644
--- a/examples/lock-app/efr32/BUILD.gn
+++ b/examples/lock-app/efr32/BUILD.gn
@@ -62,7 +62,7 @@ declare_args() {
   disable_lcd = false
 
   # Argument to Disable IPv4 for wifi(rs911)
-  chip_enable_wifi_ipv4 = true
+  chip_enable_wifi_ipv4 = false
 
   # Argument to force enable WPA3 security
   rs91x_wpa3_only = false
diff --git a/examples/thermostat/efr32/BUILD.gn b/examples/thermostat/efr32/BUILD.gn
index ba09c14ba883a8..2146ef417a0831 100644
--- a/examples/thermostat/efr32/BUILD.gn
+++ b/examples/thermostat/efr32/BUILD.gn
@@ -62,7 +62,7 @@ declare_args() {
   disable_lcd = false
 
   # Argument to Disable IPv4 for wifi(rs911)
-  chip_enable_wifi_ipv4 = true
+  chip_enable_wifi_ipv4 = false
 }
 
 declare_args() {
@@ -214,6 +214,10 @@ efr32_executable("thermostat_app") {
     sources += [ "${examples_plat_dir}/OTAConfig.cpp" ]
   }
 
+  if (chip_enable_wifi_ipv4) {
+    defines += [ "CHIP_DEVICE_CONFIG_ENABLE_IPV4" ]
+  }
+
   # WiFi Settings
   if (chip_enable_wifi) {
     if (use_rs911x) {
@@ -241,10 +245,6 @@ efr32_executable("thermostat_app") {
       sources += wf200_plat_src
       include_dirs += wf200_plat_incs
     }
-
-    if (chip_enable_wifi_ipv4) {
-      defines += [ "CHIP_DEVICE_CONFIG_ENABLE_IPV4" ]
-    }
   }
 
   if (!disable_lcd) {
diff --git a/examples/window-app/efr32/BUILD.gn b/examples/window-app/efr32/BUILD.gn
index ec9c391b86e4e8..08dabc3593696e 100644
--- a/examples/window-app/efr32/BUILD.gn
+++ b/examples/window-app/efr32/BUILD.gn
@@ -55,7 +55,7 @@ declare_args() {
   disable_lcd = false
 
   # Argument to Disable IPv4 for wifi(rs911)
-  chip_enable_wifi_ipv4 = true
+  chip_enable_wifi_ipv4 = false
 
   # Argument to force enable WPA3 security
   rs91x_wpa3_only = false
diff --git a/scripts/examples/gn_efr32_example.sh b/scripts/examples/gn_efr32_example.sh
index e756377af3250c..2169332984236d 100755
--- a/scripts/examples/gn_efr32_example.sh
+++ b/scripts/examples/gn_efr32_example.sh
@@ -144,6 +144,10 @@ else
                 optArgs+="enable_sleepy_device=true chip_openthread_ftd=false "
                 shift
                 ;;
+            --chip_enable_wifi_ipv4)
+                optArgs+="chip_enable_wifi_ipv4=true "
+                shift
+                ;;
             --additional_data_advertising)
                 optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true "
                 shift