module-setup: Add permanent option to detect static ip address or not

Dracut will die in the situation that dracut detects to use dhcp to
setup ip address, but kdump passes the ip address to it.

In commit 7ea50dc7a3, we start to use
option permanent to get the ip address in kdump_static_ip. If the
network is setuped by static, we will get the ip address, otherwise
getting none.

In commit c994a80698 which it used to
support ipv6 protocol, I miss the option permanent.

This patch is not a fixing patch, just pulls back something to make
kdump work as original.

Signed-off-by: Minfei Huang <mhuang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
This commit is contained in:
Minfei Huang 2015-08-06 21:19:26 +08:00 committed by Baoquan He
parent 4a505f62a9
commit e8e5a6a2d1

View File

@ -92,7 +92,7 @@ kdump_static_ip() {
local _netdev="$1" _srcaddr="$2" _ipv6_flag
local _netmask _gateway _ipaddr _target _nexthop
_ipaddr=$(ip addr show dev $_netdev | awk "/ $_srcaddr\/.* /{print \$2}")
_ipaddr=$(ip addr show dev $_netdev permanent | awk "/ $_srcaddr\/.* /{print \$2}")
if is_ipv6_address $_srcaddr; then
_ipv6_flag="-6"