1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

fix netifd

This commit is contained in:
suyuan 2024-01-05 22:32:21 +08:00
parent 618965851a
commit 3f43bcc620
4 changed files with 5 additions and 56 deletions

View file

@ -5,12 +5,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
#PKG_SOURCE_DATE:=2023-11-20 PKG_SOURCE_DATE:=2023-12-19
#PKG_SOURCE_VERSION:=f3e06e81b347bbdec1c6c71603328b6e442728d4 PKG_SOURCE_VERSION:=a2d32f0dcf16880226680d07b07b249f77a3af58
#PKG_MIRROR_HASH:=f16dd61aede5597fd7b5ee8e7752a916494281bc981b35c16e788ddb7409584a PKG_MIRROR_HASH:=765f51335ffa0a143421efbe129d484a90d7c4a0f3e08cb7840cc85408f3e60c
PKG_SOURCE_DATE:=2024-01-04
PKG_SOURCE_VERSION:=f01345ec13b9b27ffd314d8689fb2d3f9c81a47d
PKG_MIRROR_HASH:=58e92e9ce1a2c8ccb487e95dadf806f38b38abbe7cb3cde61ff880de5eb85c2f
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name> PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0
@ -24,8 +21,7 @@ include $(INCLUDE_DIR)/cmake.mk
define Package/netifd define Package/netifd
SECTION:=base SECTION:=base
CATEGORY:=Base system CATEGORY:=Base system
# DEPENDS:=+libuci +libnl-tiny +libubus +ubus +ubusd +jshn +libubox +libudebug DEPENDS:=+libuci +libnl-tiny +libubus +ubus +ubusd +jshn +libubox +libudebug
DEPENDS:=+libuci +libnl-tiny +libubus +ubus +ubusd +jshn +libubox
TITLE:=OpenWrt Network Interface Configuration Daemon TITLE:=OpenWrt Network Interface Configuration Daemon
endef endef

View file

@ -13,12 +13,11 @@ set_classless_routes() {
done done
} }
setup_interface() { setup_interface () {
proto_init_update "*" 1 proto_init_update "*" 1
proto_add_ipv4_address "$ip" "${subnet:-255.255.255.0}" proto_add_ipv4_address "$ip" "${subnet:-255.255.255.0}"
# TODO: apply $broadcast # TODO: apply $broadcast
local ip_net
local ip_net IP PREFIX NETWORK NETMASK BROADCAST local ip_net IP PREFIX NETWORK NETMASK BROADCAST
ipcalc "$ip/$mask" && ip_net="$NETWORK" ipcalc "$ip/$mask" && ip_net="$NETWORK"
@ -28,7 +27,6 @@ setup_interface() {
ipcalc "$i/$mask" && gw_net="$NETWORK" ipcalc "$i/$mask" && gw_net="$NETWORK"
[ "$ip_net" != "$gw_net" ] && proto_add_ipv4_route "$i" 32 "" "$ip" [ "$ip_net" != "$gw_net" ] && proto_add_ipv4_route "$i" 32 "" "$ip"
#[ "$DEFAULTROUTE" = 0 ] || proto_add_ipv4_route 0.0.0.0 0 "$i" "$ip"
proto_add_ipv4_route 0.0.0.0 0 "$i" "$ip" proto_add_ipv4_route 0.0.0.0 0 "$i" "$ip"
local r local r

View file

@ -1,7 +1,6 @@
#!/bin/sh #!/bin/sh
ifup_all= ifup_all=
setup_wifi=
if_call() { if_call() {
local interface="$1" local interface="$1"
@ -14,7 +13,6 @@ case "$0" in
*ifdown) modes=down;; *ifdown) modes=down;;
*ifup) *ifup)
modes="down up" modes="down up"
setup_wifi=1
;; ;;
*) echo "Invalid command: $0";; *) echo "Invalid command: $0";;
esac esac
@ -25,10 +23,6 @@ while :; do
ifup_all=1 ifup_all=1
shift shift
;; ;;
-w)
setup_wifi=
shift
;;
*) *)
break break
;; ;;
@ -40,7 +34,6 @@ if [ -n "$ifup_all" ]; then
for interface in $(ubus -S list 'network.interface.*'); do for interface in $(ubus -S list 'network.interface.*'); do
if_call "${interface##network.interface.}" if_call "${interface##network.interface.}"
done done
[ -n "$setup_wifi" ] && /sbin/wifi up
exit exit
else else
ubus -S list "network.interface.$1" > /dev/null || { ubus -S list "network.interface.$1" > /dev/null || {
@ -49,29 +42,3 @@ else
} }
if_call "$1" if_call "$1"
fi fi
if [ -n "$setup_wifi" ] && grep -sq config /etc/config/wireless; then
. /lib/functions.sh
find_related_radios() {
local wdev wnet
config_get wdev "$1" device
config_get wnet "$1" network
if [ -n "$wdev" ]; then
for wnet in $wnet; do
if [ "$wnet" = "$network" ]; then
append radio_devs "$wdev" "$N"
fi
done
fi
}
network="$1"
config_load wireless
config_foreach find_related_radios wifi-iface
for dev in $(echo "$radio_devs" | sort -u); do
/sbin/wifi up "$dev"
done
fi

View file

@ -1,12 +0,0 @@
--- a/system-linux.c 2023-11-24 16:49:37.715537192 +0100
+++ b/system-linux.c 2023-11-24 16:50:23.002742488 +0100
@@ -53,6 +53,9 @@
#ifndef RTN_FAILED_POLICY
#define RTN_FAILED_POLICY 12
#endif
+#ifndef RTN_POLICY_FAILED
+#define RTN_POLICY_FAILED 12
+#endif
#ifndef IFA_F_NOPREFIXROUTE
#define IFA_F_NOPREFIXROUTE 0x200