diff --git a/netifd/Makefile b/netifd/Makefile index 31fd0838a..4b5f110da 100644 --- a/netifd/Makefile +++ b/netifd/Makefile @@ -5,15 +5,15 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2023-06-04 -PKG_SOURCE_VERSION:=ec9dba72124597b7224bbfe75960386dc320f4bd -PKG_MIRROR_HASH:=baee39a3882a2b03fc83a3a6a8963c340fa8d884c7a8c9e80e7d2dddc50e24bd +PKG_SOURCE_DATE:=2021-07-26 +PKG_SOURCE_VERSION:=440eb0647708274cc8d7d9e7c2bb0cfdfba90023 +PKG_MIRROR_HASH:=eed957036ab608fdc49bdf801fc5b4405fcd2a3a5e5d3343ec39898e156c10e9 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:= -PKG_BUILD_FLAGS:=lto +PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -32,7 +32,10 @@ endef TARGET_CFLAGS += \ -I$(STAGING_DIR)/usr/include/libnl-tiny \ - -I$(STAGING_DIR)/usr/include + -I$(STAGING_DIR)/usr/include \ + -flto + +TARGET_LDFLAGS += -flto -fuse-linker-plugin CMAKE_OPTIONS += \ -DLIBNL_LIBS=-lnl-tiny \ diff --git a/netifd/files/usr/libexec/network/packet-steering.sh b/netifd/files/etc/hotplug.d/net/20-smp-packet-steering old mode 100755 new mode 100644 similarity index 92% rename from netifd/files/usr/libexec/network/packet-steering.sh rename to netifd/files/etc/hotplug.d/net/20-smp-packet-steering index 799c08080..8a86bf75f --- a/netifd/files/usr/libexec/network/packet-steering.sh +++ b/netifd/files/etc/hotplug.d/net/20-smp-packet-steering @@ -1,4 +1,6 @@ #!/bin/sh +[ "$ACTION" = add ] || exit + NPROCS="$(grep -c "^processor.*:" /proc/cpuinfo)" [ "$NPROCS" -gt 1 ] || exit @@ -38,11 +40,6 @@ packet_steering="$(uci get "network.@globals[0].packet_steering")" exec 512>/var/lock/smp_tune.lock flock 512 || exit 1 -[ -e "/usr/libexec/platform/packet-steering.sh" ] && { - /usr/libexec/platform/packet-steering.sh - exit 0 -} - for dev in /sys/class/net/*; do [ -d "$dev" ] || continue diff --git a/netifd/files/etc/init.d/packet_steering b/netifd/files/etc/init.d/packet_steering deleted file mode 100755 index 9d8f791e2..000000000 --- a/netifd/files/etc/init.d/packet_steering +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=25 -USE_PROCD=1 - -start_service() { - reload_service -} - -service_triggers() { - procd_add_reload_trigger "network" - procd_add_reload_trigger "firewall" - procd_add_raw_trigger "interface.*" 1000 /etc/init.d/packet_steering reload -} - -reload_service() { - /usr/libexec/network/packet-steering.sh -} diff --git a/netifd/files/lib/netifd/dhcp.script b/netifd/files/lib/netifd/dhcp.script index 6fcf139be..c857c9fc0 100755 --- a/netifd/files/lib/netifd/dhcp.script +++ b/netifd/files/lib/netifd/dhcp.script @@ -13,7 +13,7 @@ set_classless_routes() { done } -setup_interface () { +setup_interface() { proto_init_update "*" 1 proto_add_ipv4_address "$ip" "${subnet:-255.255.255.0}" # TODO: apply $broadcast @@ -27,6 +27,7 @@ setup_interface () { eval "$(ipcalc.sh "$i/$mask")";gw_net="$NETWORK" [ "$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" local r @@ -60,7 +61,6 @@ setup_interface () { [ -n "$message" ] && json_add_string message "$message" [ -n "$timezone" ] && json_add_int timezone "$timezone" [ -n "$lease" ] && json_add_int leasetime "$lease" - [ -n "$serverid" ] && json_add_string dhcpserver "$serverid" proto_close_data proto_send_update "$INTERFACE" diff --git a/netifd/files/lib/netifd/proto/dhcp.sh b/netifd/files/lib/netifd/proto/dhcp.sh index 636b4654f..8db848260 100755 --- a/netifd/files/lib/netifd/proto/dhcp.sh +++ b/netifd/files/lib/netifd/proto/dhcp.sh @@ -1,6 +1,6 @@ #!/bin/sh -[ -x /sbin/udhcpc ] || exit 0 +[ -L /sbin/udhcpc ] || exit 0 . /lib/functions.sh . ../netifd-proto.sh @@ -35,8 +35,8 @@ proto_dhcp_setup() { local config="$1" local iface="$2" - local ipaddr hostname clientid vendorid broadcast norelease reqopts defaultreqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute - json_get_vars ipaddr hostname clientid vendorid broadcast norelease reqopts defaultreqopts iface6rd delegate zone6rd zone mtu6rd customroutes classlessroute + local ipaddr hostname clientid vendorid broadcast norelease reqopts defaultreqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute defaultroute + json_get_vars ipaddr hostname clientid vendorid broadcast norelease reqopts defaultreqopts iface6rd delegate zone6rd zone mtu6rd customroutes classlessroute defaultroute local opt dhcpopts for opt in $reqopts; do @@ -58,6 +58,7 @@ proto_dhcp_setup() { [ -n "$zone" ] && proto_export "ZONE=$zone" [ -n "$mtu6rd" ] && proto_export "MTU6RD=$mtu6rd" [ -n "$customroutes" ] && proto_export "CUSTOMROUTES=$customroutes" + [ -n "$defaultroute" ] && proto_export "DEFAULTROUTE=$defaultroute" [ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0" # Request classless route option (see RFC 3442) by default [ "$classlessroute" = "0" ] || append dhcpopts "-O 121" @@ -67,7 +68,7 @@ proto_dhcp_setup() { -p /var/run/udhcpc-$iface.pid \ -s /lib/netifd/dhcp.script \ -f -t 0 -i "$iface" \ - ${ipaddr:+-r ${ipaddr/\/*/}} \ + ${ipaddr:+-r $ipaddr} \ ${hostname:+-x "hostname:$hostname"} \ ${vendorid:+-V "$vendorid"} \ $clientid $defaultreqopts $broadcast $norelease $dhcpopts