]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
network: fix glob matching ipv6 addresses
authorLukas Nykryn <lnykryn@redhat.com>
Tue, 10 Mar 2020 14:18:37 +0000 (15:18 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Thu, 12 Mar 2020 12:46:46 +0000 (13:46 +0100)
In this case we want to cover three cases
1) ip_address:ip_address
2) number:macaddress
3) :macaddress

We consider something an IPv6 address if it starts with number and
contains ":", but IPv6 addresses are in hexa.

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

index 16730e5b7da61fe864042e7e4969a1a1135658a8..7f185fddb509a3161b05b516e8b425e6d8e55f89 100755 (executable)
@@ -510,7 +510,7 @@ ip_to_var() {
     [ -n "$6" ] && dev=$6
     [ -n "$7" ] && autoconf=$7
     case "$8" in
-        [0-9]*:*|[0-9]*.[0-9]*.[0-9]*.[0-9]*)
+        [0-9a-fA-F]*:*|[0-9]*.[0-9]*.[0-9]*.[0-9]*)
             dns1="$8"
             [ -n "$9" ] && dns2="$9"
             ;;