From 1496ca5ceb941ba725311c6c0366193092035f32 Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Thu, 27 May 2021 13:24:47 +0200
Subject: [PATCH 01/60] netifd: update to latest HEAD

Signed-off-by: John Crispin <john@phrozen.org>
---
 package/network/config/netifd/Makefile        |  8 ++--
 .../config/netifd/patches/100-script.patch    | 21 +++++++++++
 .../config/netifd/patches/hairpin.patch       | 37 +++++++++++++++++++
 3 files changed, 61 insertions(+), 5 deletions(-)
 create mode 100644 package/network/config/netifd/patches/100-script.patch
 create mode 100644 package/network/config/netifd/patches/hairpin.patch

diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
index 4b5f110da2..d41bddfd56 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -5,16 +5,14 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
-PKG_SOURCE_DATE:=2021-07-26
-PKG_SOURCE_VERSION:=440eb0647708274cc8d7d9e7c2bb0cfdfba90023
-PKG_MIRROR_HASH:=eed957036ab608fdc49bdf801fc5b4405fcd2a3a5e5d3343ec39898e156c10e9
+PKG_SOURCE_DATE:=2021-10-20
+PKG_SOURCE_VERSION:=c61a1d432b34babe230e49a82712608b07410fc3
+PKG_MIRROR_HASH:=2b040d039c560cbc04dfe1e496aa81f714a032db88986803728dd6b724c11cd2
 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=
 
-PKG_BUILD_PARALLEL:=1
-
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
 
diff --git a/package/network/config/netifd/patches/100-script.patch b/package/network/config/netifd/patches/100-script.patch
new file mode 100644
index 0000000000..e7ba83f4bb
--- /dev/null
+++ b/package/network/config/netifd/patches/100-script.patch
@@ -0,0 +1,21 @@
+Index: a/scripts/netifd-wireless.sh
+===================================================================
+--- a/scripts/netifd-wireless.sh
++++ b/scripts/netifd-wireless.sh
+@@ -252,11 +252,14 @@ wireless_vif_parse_encryption() {
+ 			auth_type=owe
+ 		;;
+ 		wpa3-mixed*)
+-			auth_type=eap-eap192
++			auth_type=eap-eap256
+ 		;;
+-		wpa3*)
++		wpa3-192*)
+ 			auth_type=eap192
+ 		;;
++		wpa3*)
++			auth_type=eap256
++		;;
+ 		psk3-mixed*|sae-mixed*)
+ 			auth_type=psk-sae
+ 		;;
diff --git a/package/network/config/netifd/patches/hairpin.patch b/package/network/config/netifd/patches/hairpin.patch
new file mode 100644
index 0000000000..25515d75d4
--- /dev/null
+++ b/package/network/config/netifd/patches/hairpin.patch
@@ -0,0 +1,37 @@
+diff --git a/wireless.c b/wireless.c
+index b26c4e8c8f0b..bd847e72ab40 100644
+--- a/wireless.c
++++ b/wireless.c
+@@ -804,20 +804,13 @@ wireless_interface_init_config(struct wireless_interface *vif)
+ 		vif->network = cur;
+ 
+ 	cur = tb[VIF_ATTR_MODE];
+-	if (cur)
+-		vif->ap_mode = !strcmp(blobmsg_get_string(cur), "ap");
+-
+-	if (!vif->ap_mode)
+-		return;
++	vif->ap_mode = cur && !strcmp(blobmsg_get_string(cur), "ap");
+ 
+ 	cur = tb[VIF_ATTR_ISOLATE];
+-	if (cur)
+-		vif->isolate = blobmsg_get_bool(cur);
++	vif->isolate = vif->ap_mode && cur && blobmsg_get_bool(cur);
+ 
+ 	cur = tb[VIF_ATTR_PROXYARP];
+-	if (cur)
+-		vif->proxyarp = blobmsg_get_bool(cur);
+-
++	vif->proxyarp = vif->ap_mode && cur && blobmsg_get_bool(cur);
+ }
+ 
+ /* vlist update call for wireless interface list */
+@@ -846,8 +839,6 @@ vif_update(struct vlist_tree *tree, struct vlist_node *node_new,
+ 		wireless_interface_handle_link(vif_old, NULL, false);
+ 		free(vif_old->config);
+ 		vif_old->config = blob_memdup(vif_new->config);
+-		vif_old->isolate = vif_new->isolate;
+-		vif_old->ap_mode = vif_new->ap_mode;
+ 		wireless_interface_init_config(vif_old);
+ 		free(vif_new);
+ 	} else if (vif_new) {
-- 
2.25.1

