]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(iscsi): prefix syntax for static iBFT IPv6 addresses
authorMartin Wilck <mwilck@suse.com>
Fri, 3 Feb 2023 20:26:28 +0000 (21:26 +0100)
committerAntonio Álvarez Feijoo <antonio.feijoo@suse.com>
Mon, 13 Feb 2023 15:17:45 +0000 (16:17 +0100)
ibft_to_cmdline() formats a static IPv6 address like this
(without peer, gateway, hostname):

  ip="[fd09:9a46:b5c1:1fe:1::10/64]:::::ibft0:none"

This means that the "mask" field (4th) is left blank. When this is
parsed later by parse-ip-opts.sh, it bails out with the error
message "Sorry, automatic calculation of netmask is not yet supported".

parse-ip-opts.sh rather expects the prefix in the 4th field:

  ip="[fd09:9a46:b5c1:1fe:1::10]:::64::ibft0:none"

This syntax will be correctly transformed to the command

  ip addr add fd09:9a46:b5c1:1fe::10/64 dev ibft0

This patch fixes the formatting of the "ip=" line in ibft_to_cmdline().

modules.d/40network/net-lib.sh

index 43467e460700577625a3db0ce3e87e8bbcea7658..185df70a91c79ee5ef045c503ca66f0a079aac35 100755 (executable)
@@ -312,8 +312,8 @@ ibft_to_cmdline() {
                 if [ "$family" = "ipv6" ]; then
                     if [ -n "$ip" ]; then
                         [ -n "$prefix" ] || prefix=64
-                        ip="[${ip}/${prefix}]"
-                        mask=
+                        ip="[${ip}]"
+                        mask=$prefix
                     fi
                     if [ -n "$gw" ]; then
                         gw="[${gw}]"