Files
wlan-ap/backports/0037-netifd-update-to-latest-HEAD.patch
John Crispin 79e8e2e005 netifd: update to latest HEAD
Signed-off-by: John Crispin <john@phrozen.org>
2021-08-25 14:14:21 +02:00

106 lines
3.9 KiB
Diff

From 79a45074651c08e0036d4b05b9714bd0f714a115 Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Thu, 27 May 2021 13:24:47 +0200
Subject: [PATCH 06/52] netifd: update to latest HEAD
Signed-off-by: John Crispin <john@phrozen.org>
---
package/network/config/netifd/Makefile | 14 +++++++++-----
.../network/config/netifd/files/etc/udhcpc.user | 1 +
.../config/netifd/files/lib/netifd/dhcp.script | 3 +++
.../netifd/patches/002-fix-dhcp-issue.patch | 17 +++++++++++++++++
4 files changed, 30 insertions(+), 5 deletions(-)
create mode 100644 package/network/config/netifd/files/etc/udhcpc.user
create mode 100644 package/network/config/netifd/patches/002-fix-dhcp-issue.patch
diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
index 7061456b08..c33e0c2134 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-01-09
-PKG_SOURCE_VERSION:=c00c8335d6188daa326ecfe5a62da15a9b9987e1
-PKG_MIRROR_HASH:=c740e51e0cec13eec336ba1c7a643db3b64a9a2235f8c1b73a566cb89e841190
+PKG_SOURCE_DATE:=2021-08-24
+PKG_SOURCE_VERSION:=454e9c33c90691d5bea12263f1801a7dc38c20b1
+PKG_MIRROR_HASH:=b8c6d8a1d0cb60c353c0272b8a526d8e28e6ee7d385e96b18018d1bc13b54cc2
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
@@ -25,6 +23,11 @@ define Package/netifd
TITLE:=OpenWrt Network Interface Configuration Daemon
endef
+define Package/netifd/conffiles
+/etc/udhcpc.user
+/etc/udhcpc.user.d/
+endef
+
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include/libnl-tiny \
-I$(STAGING_DIR)/usr/include \
@@ -40,6 +43,7 @@ define Package/netifd/install
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/netifd $(1)/sbin/
$(CP) ./files/* $(1)/
+ $(INSTALL_DIR) $(1)/etc/udhcpc.user.d/
$(CP) $(PKG_BUILD_DIR)/scripts/* $(1)/lib/netifd/
endef
diff --git a/package/network/config/netifd/files/etc/udhcpc.user b/package/network/config/netifd/files/etc/udhcpc.user
new file mode 100644
index 0000000000..78e2ba5f18
--- /dev/null
+++ b/package/network/config/netifd/files/etc/udhcpc.user
@@ -0,0 +1 @@
+# This script is sourced by udhcpc's dhcp.script at every DHCP event.
diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script b/package/network/config/netifd/files/lib/netifd/dhcp.script
index 6585b641d6..e46005d84c 100755
--- a/package/network/config/netifd/files/lib/netifd/dhcp.script
+++ b/package/network/config/netifd/files/lib/netifd/dhcp.script
@@ -112,5 +112,8 @@ esac
# user rules
[ -f /etc/udhcpc.user ] && . /etc/udhcpc.user "$@"
+for f in /etc/udhcpc.user.d/*; do
+ [ -f "$f" ] && (. "$f" "$@")
+done
exit 0
diff --git a/package/network/config/netifd/patches/002-fix-dhcp-issue.patch b/package/network/config/netifd/patches/002-fix-dhcp-issue.patch
new file mode 100644
index 0000000000..6f1d2e708e
--- /dev/null
+++ b/package/network/config/netifd/patches/002-fix-dhcp-issue.patch
@@ -0,0 +1,17 @@
+Index: netifd-2019-08-05-5e02f944/interface.c
+===================================================================
+--- netifd-2019-08-05-5e02f944.orig/interface.c
++++ netifd-2019-08-05-5e02f944/interface.c
+@@ -424,7 +424,11 @@ interface_main_dev_cb(struct device_user
+ interface_set_link_state(iface, false);
+ break;
+ case DEV_EVENT_TOPO_CHANGE:
+- interface_proto_event(iface->proto, PROTO_CMD_RENEW, false);
++ /* This renews the dhcp lease when the bridge adds/deletes a
++ * new interface. It causes some dhcp servers to fail in
++ * case where there are many interfaces being added to the
++ * bridge frequently. Disabling this for now. */
++ /* interface_proto_event(iface->proto, PROTO_CMD_RENEW, false); */
+ return;
+ default:
+ break;
--
2.25.1