[OpenWrt-Devel] [PATCH] [toolchain] Stop generating a broken symlink in TOOLCHAIN_DIR/lib
It turns out that the symlink may exists already by the time the toolchain Makefile gets an opportunity to run. While we asked to replace the target, ln doesn't do so until after dereferencing the existing symlink. This results in an unintended symlink that refers to itself. Instead, create the link without dereferencing any symlinks by using the -n option. Signed-off-by: John Szakmeister --- Here's the patch with my Signed-off-by. Thank you for the feedback Florian! -John toolchain/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain/Makefile b/toolchain/Makefile index bdfb29e..763381a 100644 --- a/toolchain/Makefile +++ b/toolchain/Makefile @@ -63,7 +63,7 @@ ifneq ($(ARCH),) $(if $(QUIET),,set -x;) \ mkdir -p "$$dir"; \ cd "$$dir"; \ - ln -sf lib lib64; \ + ln -nsf lib lib64; \ mkdir -p stamp lib usr/include usr/lib ; \ ); done @grep GCC_VERSION $@ >/dev/null 2>&1 || $(INSTALL_DATA) $(TOPDIR)/toolchain/info.mk $@ -- 1.8.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH][qos] setup ipv6 rules in qos
Setup ip6tables rules for qos settings if ip6tables is present and there is qos enabled in some interface (default config also contains wan6 interface). Signed-off-by Ilkka Ollakka -- Ilkka Ollakka Also, the Scots are said to have invented golf. Then they had to invent Scotch whiskey to take away the pain and frustration. Index: generate.sh === --- generate.sh (revision 36111) +++ generate.sh (working copy) @@ -1,5 +1,6 @@ #!/bin/sh [ -e /lib/functions.sh ] && . /lib/functions.sh || . ./functions.sh +[ -e /lib/functions/network.sh ] && . /lib/functions/network.sh [ -x /sbin/modprobe ] && { insmod="modprobe" rmmod="$insmod -r" @@ -395,18 +396,25 @@ local iptrules local pktrules local sizerules + local gateway_available enum_classes "$cg" - add_rules iptrules "$ctrules" "iptables -t mangle -A qos_${cg}_ct" + for command in $iptables; do + add_rules iptrules "$ctrules" "$command -t mangle -A qos_${cg}_ct" + done config_get classes "$cg" classes for class in $classes; do config_get mark "$class" classnr config_get maxsize "$class" maxsize [ -z "$maxsize" -o -z "$mark" ] || { - add_insmod ipt_length - append pktrules "iptables -t mangle -A qos_${cg} -m mark --mark $mark/0xff -m length --length $maxsize: -j MARK --set-mark 0/0xff" "$N" + add_insmod ipt_length + for command in $iptables; do + append pktrules "$command -t mangle -A qos_${cg} -m mark --mark $mark/0xff -m length --length $maxsize: -j MARK --set-mark 0/0xff" "$N" + done } done - add_rules pktrules "$rules" "iptables -t mangle -A qos_${cg}" + for command in $iptables; do + add_rules pktrules "$rules" "$command -t mangle -A qos_${cg}" + done for iface in $INTERFACES; do config_get classgroup "$iface" classgroup config_get device "$iface" device @@ -415,16 +423,38 @@ config_get download "$iface" download config_get halfduplex "$iface" halfduplex download="${download:-${halfduplex:+$upload}}" - append up "iptables -t mangle -A OUTPUT -o $device -j qos_${cg}" "$N" - append up "iptables -t mangle -A FORWARD -o $device -j qos_${cg}" "$N" + network_get_gateway6 gateway_available "$iface" + if [ "$gateway_available" != "" -a -x /usr/sbin/ip6tables ]; then + append up "ip6tables -t mangle -A OUTPUT -o $device -j qos_${cg}" "$N" + append up "ip6tables -t mangle -A FORWARD -o $device -j qos_${cg}" "$N" + fi + network_get_gateway gateway_available "$iface" + if [ "$gateway_available" != "" ]; then + append up "iptables -t mangle -A OUTPUT -o $device -j qos_${cg}" "$N" + append up "iptables -t mangle -A FORWARD -o $device -j qos_${cg}" "$N" + fi done cat <&- 2>&- -iptables -t mangle -N qos_${cg}_ct >&- 2>&- -${iptrules:+${iptrules}${N}iptables -t mangle -A qos_${cg}_ct -j CONNMARK --save-mark --mask 0xff} -iptables -t mangle -A qos_${cg} -j CONNMARK --restore-mark --mask 0xff -iptables -t mangle -A qos_${cg} -m mark --mark 0/0xff -j qos_${cg}_ct +EOF + +for command in $iptables; do + cat < signature.asc Description: Digital signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel