Revert "rd.route should use the name from kdump_setup_ifname"

This reverts commit 18ffd3cb17.
This commit is contained in:
Kairui Song 2021-04-28 15:00:21 +08:00
parent 18ffd3cb17
commit 4753ab2c70

View File

@ -235,7 +235,7 @@ cal_netmask_by_prefix() {
#$2: srcaddr #$2: srcaddr
#if it use static ip echo it, or echo null #if it use static ip echo it, or echo null
kdump_static_ip() { kdump_static_ip() {
local _netdev="$1" _srcaddr="$2" kdumpnic="$3" _ipv6_flag local _netdev="$1" _srcaddr="$2" _ipv6_flag
local _netmask _gateway _ipaddr _target _nexthop _prefix local _netmask _gateway _ipaddr _target _nexthop _prefix
_ipaddr=$(ip addr show dev $_netdev permanent | awk "/ $_srcaddr\/.* /{print \$2}") _ipaddr=$(ip addr show dev $_netdev permanent | awk "/ $_srcaddr\/.* /{print \$2}")
@ -273,14 +273,14 @@ kdump_static_ip() {
_target="[$_target]" _target="[$_target]"
_nexthop="[$_nexthop]" _nexthop="[$_nexthop]"
fi fi
echo "rd.route=$_target:$_nexthop:$kdumpnic" echo "rd.route=$_target:$_nexthop:$_netdev"
done >> ${initdir}/etc/cmdline.d/45route-static.conf done >> ${initdir}/etc/cmdline.d/45route-static.conf
kdump_handle_mulitpath_route $_netdev $_srcaddr $kdumpnic kdump_handle_mulitpath_route $_netdev $_srcaddr
} }
kdump_handle_mulitpath_route() { kdump_handle_mulitpath_route() {
local _netdev="$1" _srcaddr="$2" kdumpnic="$3" _ipv6_flag local _netdev="$1" _srcaddr="$2" _ipv6_flag
local _target _nexthop _route _weight _max_weight _rule local _target _nexthop _route _weight _max_weight _rule
if is_ipv6_address $_srcaddr; then if is_ipv6_address $_srcaddr; then
@ -299,9 +299,9 @@ kdump_handle_mulitpath_route() {
_nexthop=`echo "$_route" | cut -d ' ' -f3` _nexthop=`echo "$_route" | cut -d ' ' -f3`
_max_weight=$_weight _max_weight=$_weight
if [ "x" != "x"$_ipv6_flag ]; then if [ "x" != "x"$_ipv6_flag ]; then
_rule="rd.route=[$_target]:[$_nexthop]:$kdumpnic" _rule="rd.route=[$_target]:[$_nexthop]:$_netdev"
else else
_rule="rd.route=$_target:$_nexthop:$kdumpnic" _rule="rd.route=$_target:$_nexthop:$_netdev"
fi fi
fi fi
else else
@ -491,7 +491,7 @@ kdump_install_net() {
kdump_setup_znet $_netdev kdump_setup_znet $_netdev
fi fi
_static=$(kdump_static_ip $_netdev $_srcaddr $kdumpnic) _static=$(kdump_static_ip $_netdev $_srcaddr)
if [ -n "$_static" ]; then if [ -n "$_static" ]; then
_proto=none _proto=none
elif is_ipv6_address $_srcaddr; then elif is_ipv6_address $_srcaddr; then