From 18ffd3cb174e01ea18c8c56ac7b1503168bf0ec2 Mon Sep 17 00:00:00 2001 From: Coiby Xu Date: Sun, 25 Apr 2021 15:58:27 +0800 Subject: [PATCH] rd.route should use the name from kdump_setup_ifname This fix bz1854037 which happens because kexec-tools generates rd.route for eth0 instead of for kdump-eth0, 1. "rd.route=168.63.129.16:10.0.0.1:eth0 rd.route=169.254.169.254:10.0.0.1:eth0" is passed to the dracut cmdline by kexec-tools 2. In the 2rd kernel, - dracut/modules.d/40network/net-lib.sh will write /tmp/net.route.eth0 based on rd.route - dracut/modules.d/45ifcfg/write-ifcfg.sh will copy /tmp/net.route.eth0 to /tmp/icfg and then copytree /tmp/ifcfg to /run/initramfs/state/etc/sysconfig/network-scripts 3. NetworkManager will try to get an IP for eth0 regardless of the fact it's a slave NIC and time out ``` $ ip link show 2: kdump-eth0: mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether 00:0d:3a:11:86:8b brd ff:ff:ff:ff:ff:ff 3: eth0: mtu 1500 qdisc mq master kdump-eth0 state UP mode DEFAULT group default qlen 1000 ``` Reported-by: Huijing Hei Signed-off-by: Coiby Xu Acked-by: Kairui Song > ${initdir}/etc/cmdline.d/45route-static.conf - kdump_handle_mulitpath_route $_netdev $_srcaddr + kdump_handle_mulitpath_route $_netdev $_srcaddr $kdumpnic } kdump_handle_mulitpath_route() { - local _netdev="$1" _srcaddr="$2" _ipv6_flag + local _netdev="$1" _srcaddr="$2" kdumpnic="$3" _ipv6_flag local _target _nexthop _route _weight _max_weight _rule if is_ipv6_address $_srcaddr; then @@ -299,9 +299,9 @@ kdump_handle_mulitpath_route() { _nexthop=`echo "$_route" | cut -d ' ' -f3` _max_weight=$_weight if [ "x" != "x"$_ipv6_flag ]; then - _rule="rd.route=[$_target]:[$_nexthop]:$_netdev" + _rule="rd.route=[$_target]:[$_nexthop]:$kdumpnic" else - _rule="rd.route=$_target:$_nexthop:$_netdev" + _rule="rd.route=$_target:$_nexthop:$kdumpnic" fi fi else @@ -491,7 +491,7 @@ kdump_install_net() { kdump_setup_znet $_netdev fi - _static=$(kdump_static_ip $_netdev $_srcaddr) + _static=$(kdump_static_ip $_netdev $_srcaddr $kdumpnic) if [ -n "$_static" ]; then _proto=none elif is_ipv6_address $_srcaddr; then