File kdump-IPv6-setup-pass-address-prefix-in-separate-dracut-arg.patch of Package kdump.8867
From: Michal Koutný <mkoutny@suse.com>
Date: Mon Mar 26 20:34:19 2018 +0200
Subject: IPv6 setup: pass address prefix in separate dracut arg
References: bsc#1062026, bsc#1093795
Upstream: merged
Git-commit: c6fb83e6ebc310c615c145962f71b3f6f4819e88
Dracut distinguishes IPv6 addresses by bracket enclosing [1] so pass an
IPv6 address as such. The address prefix is passed separately through
netmask dracut argument (that is a slight misnomer as dracut just
propagates that value to iproute2 tools [2] which interpret it as
decimal number of prefix bits).
[1] https://github.com/dracutdevs/dracut/blob/031e2f7bb8aea447cd87e455b184106acb4aa435/modules.d/40network/net-lib.sh#L441
[2] https://github.com/dracutdevs/dracut/blob/031e2f7bb8aea447cd87e455b184106acb4aa435/modules.d/40network/ifup.sh#L130
---
init/setup-kdump.functions | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/init/setup-kdump.functions
+++ b/init/setup-kdump.functions
@@ -568,7 +568,7 @@ function kdump_ip6_config() # {{
{
local iface="$1"
local bootif="$2"
- local ipaddr peeraddr gwaddr hostname
+ local ipaddr peeraddr gwaddr netmask hostname
local family cidr rest prefix
hostname=$(hostname)
@@ -580,7 +580,8 @@ function kdump_ip6_config() # {{
ipaddr="${cidr%/*}"
prefix="${cidr:${#ipaddr}}"
- ipaddr="[$ipaddr]$prefix"
+ netmask="${prefix:1}"
+ ipaddr="[$ipaddr]"
set -- $rest
if [ "$1" == "peer" ] ; then
@@ -591,7 +592,7 @@ function kdump_ip6_config() # {{
peeraddr=
fi
- echo "ip=$ipaddr:$peeraddr:$gwaddr::$hostname:$bootif:none"
+ echo "ip=$ipaddr:$peeraddr:$gwaddr:$netmask:$hostname:$bootif:none"
done < <(ip -6 address show dev "$iface" permanent scope global)
} # }}}