Handle upper case MAC addresses in ifname option
PATCH 1/3 Handle upper case MAC addresses in ifname option
While the documentation states that ifname MAC addresses must be lower case, we silently accept upper case ones and fail later on when udev doesn't rename the device.
Instead of adding sanity checking on the MAC address just convert it to lower case and remove the requirement completely.
---
modules.d/40network/parse-ifname.sh +2 -1
@@ -25,7 +25,8 @@ parse_ifname_opts() { case $# in 7) ifname_if=$1 - ifname_mac=$2:$3:$4:$5:$6:$7 + # udev requires MAC addresses to be lower case + ifname_mac=`echo $2:$3:$4:$5:$6:$7 | tr '[:upper:]' '[:lower:]'` ;; *) die "Invalid arguments for ifname="
dracut.cmdline.7.xml +0 -1
@@ -464,7 +464,6 @@ This parameter can be specified multiple <term><envar>ifname=</envar><replaceable><interface></replaceable>:<replaceable><MAC></replaceable></term> <listitem> <para>Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>. -Note letters in the MAC-address must be lowercase! <remark>Note: If you use this option you <emphasis remap="B">must</emphasis> specify an ifname= argument for all interfaces used in ip= or fcoe= arguments.</remark> This parameter can be specified multiple times.</para> </listitem>
PATCH 2/3 server-id in ip= is not optional
The documentation suggests that server-id is an optional argument but ip_to_var fails if it is not specified. Fix the documentation.
---
dracut.cmdline.7.xml +2 -2
@@ -452,9 +452,9 @@ with a valid DHCP root-path.</para> </listitem> </varlistentry> <varlistentry> - <term><envar>ip=</envar><replaceable><client-IP></replaceable>:<optional> + <term><envar>ip=</envar><replaceable><client-IP></replaceable>: <replaceable><server-id></replaceable> - </optional>:<replaceable><gateway-IP></replaceable>:<replaceable><netmask></replaceable>:<replaceable><client_hostname></replaceable>:<replaceable><interface></replaceable>:<replaceable>{none|off}</replaceable></term> + :<replaceable><gateway-IP></replaceable>:<replaceable><netmask></replaceable>:<replaceable><client_hostname></replaceable>:<replaceable><interface></replaceable>:<replaceable>{none|off}</replaceable></term> <listitem> <para>explicit network configuration. If you want do define a IPv6 address, put it in brackets (e.g. [2001:DB8::1]). This parameter can be specified multiple times.</para>
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 2/3] server-id in ip= is not optional
pushed
PATCH 3/3 ip= server-id should be server-IP
In reply to Anton Blanchard From looking at the code it seems like server-id should really
be named server-IP.
---
dracut.cmdline.7.xml +1 -1
@@ -453,7 +453,7 @@ with a valid DHCP root-path.</para> </varlistentry> <varlistentry> <term><envar>ip=</envar><replaceable><client-IP></replaceable>: - <replaceable><server-id></replaceable> + <replaceable><server-IP></replaceable> :<replaceable><gateway-IP></replaceable>:<replaceable><netmask></replaceable>:<replaceable><client_hostname></replaceable>:<replaceable><interface></replaceable>:<replaceable>{none|off}</replaceable></term> <listitem> <para>explicit network configuration. If you want do define a IPv6 address, put it in brackets (e.g. [2001:DB8::1]).
modules.d/40network/parse-ip-opts.sh +1 -1
@@ -7,7 +7,7 @@ # # ip=<interface>:[dhcp|on|any] # -# ip=<client-IP-number>:<server-id>:<gateway-IP-number>:<netmask>:<client-hostname>:<interface>:[dhcp|on|any|none|off] +# ip=<client-IP-number>:<server-IP-number>:<gateway-IP-number>:<netmask>:<client-hostname>:<interface>:[dhcp|on|any|none|off] # # When supplying more than only ip= line, <interface> is mandatory and # bootdev= must contain the name of the primary interface to use for
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 3/3] ip= server-id should be server-IP
pushed
A message that is not in the archive (sent off-list or not yet received): [email protected]
modules.d/40network/parse-ifname.sh parse_ifname_opts() { · line 29
Quoted 9 lines · Anton Blanchard
modules.d/40network/parse-ifname.sh +2
-1@@ -25,7 +25,8 @@ parse_ifname_opts() { case $# in 7) ifname_if=$1 - ifname_mac=$2:$3:$4:$5:$6:$7 + # udev requires MAC addresses to be lower case + ifname_mac=`echo $2:$3:$4:$5:$6:$7 | tr '[:upper:]' '[:lower:]'`
Admittedly, I've not checked the latest git version, but dracut doesn't install 'tr' to the initramfs, at least not in RHEL 6.
Dave
pushed