1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-24 20:24:15 +02:00

[package] base-files: disable ipv6 on bridge ports, this prevents stray RA assigned and link local addresses on bridge member devices

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@24194 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2010-11-30 00:46:21 +00:00
parent 191062a0ed
commit 293671d952

View File

@ -3,6 +3,12 @@
# DEBUG="echo" # DEBUG="echo"
do_sysctl() {
[ -n "$2" ] && \
sysctl -n -e -w "$1=$2" >/dev/null || \
sysctl -n -e "$1"
}
find_config() { find_config() {
local iftype device iface ifaces ifn local iftype device iface ifaces ifn
for ifn in $interfaces; do for ifn in $interfaces; do
@ -164,14 +170,10 @@ prepare_interface() {
local macaddr local macaddr
config_get macaddr "$config" macaddr config_get macaddr "$config" macaddr
[ -x /usr/sbin/brctl ] && { [ -x /usr/sbin/brctl ] && {
# Remove IPv6 link local addr before adding the iface to the bridge # Disable IPv6 for bridge ports
local llv6="$(ifconfig "$iface")" do_sysctl net.ipv6.conf.$iface.disable_ipv6 1
case "$llv6" in [ "${iface##wlan}" != "$iface" ] && \
*fe80:*/64*) do_sysctl net.ipv6.conf.mon.$iface.disable_ipv6 1
llv6="${llv6#* fe80:}"
ifconfig "$iface" del "fe80:${llv6%% *}"
;;
esac
ifconfig "br-$config" 2>/dev/null >/dev/null && { ifconfig "br-$config" 2>/dev/null >/dev/null && {
local newdevs devices local newdevs devices
@ -411,6 +413,9 @@ unbridge() {
for brdev in $(brctl show | awk '$2 ~ /^[0-9].*\./ { print $1 }'); do for brdev in $(brctl show | awk '$2 ~ /^[0-9].*\./ { print $1 }'); do
brctl delif "$brdev" "$dev" 2>/dev/null >/dev/null brctl delif "$brdev" "$dev" 2>/dev/null >/dev/null
do_sysctl net.ipv6.conf.$dev.disable_ipv6 0
[ "${dev##wlan}" != "$dev" ] && \
do_sysctl net.ipv6.conf.mon.$dev.disable_ipv6 0
done done
} }
} }