dracut-module-setup.sh: pass correct ip= param for ipv6
Kdump always use _proto=dhcp for both ipv4 and ipv6. But for ipv6 the dhcp address assignment is not like ipv4, there are different ways for it, stateless and stateful, see below document: https://fedoraproject.org/wiki/IPv6Guide In case stateless, kernel can do the address assignment, dracut use _proto=auto6; for stateful case, dracut use _proto=dhcp6. We do not see bug reports before because for the most auto6 cases kernel assign ip address before dhclient, kdump just happened to work. Here we use auto6 if possible first. And we take the assumption that host use auto6 if /proc/sys/net/ipv6/conf/$netdev/autoconf is enabled Signed-off-by: Pingfan Liu <piliu@redhat.com>
This commit is contained in:
parent
4d1e8aadc8
commit
2f4149f276
@ -293,6 +293,12 @@ kdump_setup_netdev() {
|
|||||||
_static=$(kdump_static_ip $_netdev $_srcaddr)
|
_static=$(kdump_static_ip $_netdev $_srcaddr)
|
||||||
if [ -n "$_static" ]; then
|
if [ -n "$_static" ]; then
|
||||||
_proto=none
|
_proto=none
|
||||||
|
elif is_ipv6_address $_srcaddr; then
|
||||||
|
if is_ipv6_auto $_netdev; then
|
||||||
|
_proto=auto6
|
||||||
|
else
|
||||||
|
_proto=dhcp6
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
_proto=dhcp
|
_proto=dhcp
|
||||||
fi
|
fi
|
||||||
|
12
kdump-lib.sh
12
kdump-lib.sh
@ -310,6 +310,18 @@ is_atomic()
|
|||||||
grep -q "ostree" /proc/cmdline
|
grep -q "ostree" /proc/cmdline
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# fixme, try the best to decide whether the ipv6 addr is allocated by slaac or dhcp6
|
||||||
|
is_ipv6_auto()
|
||||||
|
{
|
||||||
|
local _netdev=$1
|
||||||
|
local _auto=$(cat /proc/sys/net/ipv6/conf/$_netdev/autoconf)
|
||||||
|
if [ $_auto -eq 1 ]; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
is_ipv6_address()
|
is_ipv6_address()
|
||||||
{
|
{
|
||||||
echo $1 | grep -q ":"
|
echo $1 | grep -q ":"
|
||||||
|
Loading…
Reference in New Issue
Block a user