projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[base-files] Don't do lazy unmounting of filessystems at reboot/poweroff.
[openwrt.git]
/
package
/
base-files
/
files
/
lib
/
network
/
config.sh
diff --git
a/package/base-files/files/lib/network/config.sh
b/package/base-files/files/lib/network/config.sh
index
fbbf0e1
..
12b08a2
100755
(executable)
--- a/
package/base-files/files/lib/network/config.sh
+++ b/
package/base-files/files/lib/network/config.sh
@@
-233,48
+233,50
@@
setup_interface_alias() {
}
setup_interface() {
}
setup_interface() {
- local iface="$1"
+ local iface
_main
="$1"
local config="$2"
local proto="$3"
local vifmac="$4"
local config="$2"
local proto="$3"
local vifmac="$4"
+ local ip6addr_main=
[ -n "$config" ] || {
[ -n "$config" ] || {
- config=$(find_config "$iface")
+ config=$(find_config "$iface
_main
")
[ "$?" = 0 ] || return 1
}
[ "$?" = 0 ] || return 1
}
- prepare_interface "$iface" "$config" "$vifmac" || return 0
+ prepare_interface "$iface
_main
" "$config" "$vifmac" || return 0
- [ "$iface" = "br-$config" ] && {
+ [ "$iface
_main
" = "br-$config" ] && {
# need to bring up the bridge and wait a second for
# it to switch to the 'forwarding' state, otherwise
# it will lose its routes...
# need to bring up the bridge and wait a second for
# it to switch to the 'forwarding' state, otherwise
# it will lose its routes...
- ifconfig "$iface" up
+ ifconfig "$iface
_main
" up
sleep 1
}
# Interface settings
sleep 1
}
# Interface settings
- grep "$iface:" /proc/net/dev > /dev/null && {
+ grep "$iface
_main
:" /proc/net/dev > /dev/null && {
local mtu macaddr
config_get mtu "$config" mtu
config_get macaddr "$config" macaddr
local mtu macaddr
config_get mtu "$config" mtu
config_get macaddr "$config" macaddr
- [ -n "$macaddr" ] && $DEBUG ifconfig "$iface" down
- $DEBUG ifconfig "$iface" ${macaddr:+hw ether "$macaddr"} ${mtu:+mtu $mtu} up
+ [ -n "$macaddr" ] && $DEBUG ifconfig "$iface
_main
" down
+ $DEBUG ifconfig "$iface
_main
" ${macaddr:+hw ether "$macaddr"} ${mtu:+mtu $mtu} up
}
}
- set_interface_ifname "$config" "$iface"
+ set_interface_ifname "$config" "$iface
_main
"
- pidfile="/var/run/$iface.pid"
+ pidfile="/var/run/$iface
_main
.pid"
[ -n "$proto" ] || config_get proto "$config" proto
case "$proto" in
static)
[ -n "$proto" ] || config_get proto "$config" proto
case "$proto" in
static)
- setup_interface_static "$iface" "$config"
+ config_get ip6addr_main "$config" ip6addr
+ setup_interface_static "$iface_main" "$config"
;;
dhcp)
# prevent udhcpc from starting more than once
;;
dhcp)
# prevent udhcpc from starting more than once
- lock "/var/lock/dhcp-$iface"
+ lock "/var/lock/dhcp-$iface
_main
"
local pid="$(cat "$pidfile" 2>/dev/null)"
if [ -d "/proc/$pid" ] && grep udhcpc "/proc/${pid}/cmdline" >/dev/null 2>/dev/null; then
local pid="$(cat "$pidfile" 2>/dev/null)"
if [ -d "/proc/$pid" ] && grep udhcpc "/proc/${pid}/cmdline" >/dev/null 2>/dev/null; then
- lock -u "/var/lock/dhcp-$iface"
+ lock -u "/var/lock/dhcp-$iface
_main
"
else
local ipaddr netmask hostname proto1 clientid
config_get ipaddr "$config" ipaddr
else
local ipaddr netmask hostname proto1 clientid
config_get ipaddr "$config" ipaddr
@@
-284,21
+286,21
@@
setup_interface() {
config_get clientid "$config" clientid
[ -z "$ipaddr" ] || \
config_get clientid "$config" clientid
[ -z "$ipaddr" ] || \
- $DEBUG ifconfig "$iface" "$ipaddr" ${netmask:+netmask "$netmask"}
+ $DEBUG ifconfig "$iface
_main
" "$ipaddr" ${netmask:+netmask "$netmask"}
# don't stay running in background if dhcp is not the main proto on the interface (e.g. when using pptp)
local dhcpopts
[ ."$proto1" != ."$proto" ] && dhcpopts="-n -q"
# don't stay running in background if dhcp is not the main proto on the interface (e.g. when using pptp)
local dhcpopts
[ ."$proto1" != ."$proto" ] && dhcpopts="-n -q"
- $DEBUG eval udhcpc -t 0 -i "$iface
" ${ipaddr:+-r $ipaddr} ${hostname:+-H $hostname} ${clientid:+-c $clientid} -b -p "$pidfile" ${dhcpopts:-
-R &}
- lock -u "/var/lock/dhcp-$iface"
+ $DEBUG eval udhcpc -t 0 -i "$iface
_main" ${ipaddr:+-r $ipaddr} ${hostname:+-H $hostname} ${clientid:+-c $clientid} -b -p "$pidfile" ${dhcpopts:- -O rootpath
-R &}
+ lock -u "/var/lock/dhcp-$iface
_main
"
fi
;;
none)
fi
;;
none)
- setup_interface_none "$iface" "$config"
+ setup_interface_none "$iface
_main
" "$config"
;;
*)
if ( eval "type setup_interface_$proto" ) >/dev/null 2>/dev/null; then
;;
*)
if ( eval "type setup_interface_$proto" ) >/dev/null 2>/dev/null; then
- eval "setup_interface_$proto '$iface' '$config' '$proto'"
+ eval "setup_interface_$proto '$iface
_main
' '$config' '$proto'"
else
echo "Interface type $proto not supported."
return 1
else
echo "Interface type $proto not supported."
return 1
@@
-306,7
+308,7
@@
setup_interface() {
;;
esac
[ "$proto" = none ] || {
;;
esac
[ "$proto" = none ] || {
- for ifn in `ifconfig | grep "^$iface:" | awk '{print $1}'`; do
+ for ifn in `ifconfig | grep "^$iface
_main
:" | awk '{print $1}'`; do
ifconfig "$ifn" down
done
}
ifconfig "$ifn" down
done
}
@@
-314,9
+316,15
@@
setup_interface() {
local aliases
config_set "$config" aliases ""
config_set "$config" alias_count 0
local aliases
config_set "$config" aliases ""
config_set "$config" alias_count 0
- config_foreach setup_interface_alias alias "$config" "$iface"
+ config_foreach setup_interface_alias alias "$config" "$iface
_main
"
config_get aliases "$config" aliases
[ -z "$aliases" ] || uci_set_state network "$config" aliases "$aliases"
config_get aliases "$config" aliases
[ -z "$aliases" ] || uci_set_state network "$config" aliases "$aliases"
+
+ # put the ip6addr back to the beginning to become the main ip again
+ [ -z "$ip6addr_main" ] || {
+ $DEBUG ifconfig "$iface_main" del "$ip6addr_main"
+ $DEBUG ifconfig "$iface_main" add "$ip6addr_main"
+ }
}
unbridge() {
}
unbridge() {
This page took
0.031879 seconds
and
4
git commands to generate.