module-setup: Choose the first matched gateway in kdump_static_ip
The system may have multiple default route entry. Following is an example to show the details. # ip -6 route list dev eth0 2620:52:0:1040::/64 proto kernel metric 256 expires 2591978sec fe80::/64 proto kernel metric 256 default via fe80:52:0:1040::1 proto ra metric 1024 expires 1778sec hoplimit 64 default via fe80:52:0:1040::2 proto ra metric 1024 expires 1778sec hoplimit 64 Choose the first matched entry. Signed-off-by: Minfei Huang <mhuang@redhat.com> Acked-by: Baoquan He <bhe@redhat.com>
This commit is contained in:
parent
e8e5a6a2d1
commit
b57fd97ba5
@ -99,7 +99,8 @@ kdump_static_ip() {
|
||||
fi
|
||||
|
||||
if [ -n "$_ipaddr" ]; then
|
||||
_gateway=$(ip $_ipv6_flag route list dev $_netdev | awk '/^default /{print $3}')
|
||||
_gateway=$(ip $_ipv6_flag route list dev $_netdev | \
|
||||
awk '/^default /{print $3}' | head -n 1)
|
||||
|
||||
if [ "x" != "x"$_ipv6_flag ]; then
|
||||
# _ipaddr="2002::56ff:feb6:56d5/64", _netmask is the number after "/"
|
||||
|
Loading…
Reference in New Issue
Block a user