On 08/24/2017 at 02:00 PM, Ziyue Yang wrote:
Current logic in kdump_install_net will find the network
interface to use by "ip route" command, which might be
different from what user specified in kdump.conf in link
local ipv6 cases.
This commit changes logic in kdump_install_net to use
network interface specified in link local ipv6 cases.
Signed-off-by: Ziyue Yang <ziyang(a)redhat.com>
---
dracut-module-setup.sh | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index ae13337..9e70d15 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -341,12 +341,20 @@ kdump_install_net() {
_server=`echo $_serv_tmp | cut -d' ' -f1`
fi
- _route=`/sbin/ip -o route get to $_server 2>&1`
- [ $? != 0 ] && echo "Bad kdump location: $config_val" &&
exit 1
+ if is_ipv6_link_local $_server; then
+ # use network interface specified by link local address
+ _netdev=${config_val##*\%}
+ _route=`/sbin/ip -o route get to $_server dev $_netdev 2>&1`
`` is deprecated, please change to use $(...) instead once we touched the old code.
+ [ $? != 0 ] && echo "Bad kdump location:
$config_val" && exit 1
+ _srcaddr=$(get_ip_route_field "$_route" "src")
+ else
+ _route=`/sbin/ip -o route get to $_server 2>&1`
+ [ $? != 0 ] && echo "Bad kdump location: $config_val"
&& exit 1
- #the field in the ip output changes if we go to another subnet
- _srcaddr=$(get_ip_route_field "$_route" "src")
- _netdev=$(get_ip_route_field "$_route" "dev")
+ #the field in the ip output changes if we go to another subnet
+ _srcaddr=$(get_ip_route_field "$_route" "src")
+ _netdev=$(get_ip_route_field "$_route" "dev")
+ fi
kdump_setup_netdev "${_netdev}" "${_srcaddr}"