Skip to content

Commit

Permalink
fix(iscsi): prefix syntax for static iBFT IPv6 addresses
Browse files Browse the repository at this point in the history
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().
  • Loading branch information
mwilck authored and aafeijoo-suse committed Feb 13, 2023
1 parent aa5d952 commit c3b65a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules.d/40network/net-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}]"
Expand Down

0 comments on commit c3b65a4

Please sign in to comment.