Re: [PATCH] tools: hv: Fix how ifcfg-* file is created

From: Tomas Hozza
Date: Mon Feb 25 2013 - 02:41:40 EST

----- Original Message -----
> On Sun, Jan 13, Tomas Hozza wrote:
> > -# IPADDR=ipaddr1
> > -# IPADDR_1=ipaddr2
> > -# IPADDR_x=ipaddry (where y = x + 1)
> > +# IPADDR0=ipaddr1
> > +# IPADDR1=ipaddr2
> > +# IPADDRx=ipaddry (where y = x + 1)
> Before this change it was IPADDR=, now its IPADDR0=.
> Furthermore, IPADDR_n was changed to IPADDRn.

>From initscripts (ifcfg-* part) documentation:

Base items:
Most important for PPP. Only used in front ends.
devices where it is the "logical name")>
Network prefix. It is used for all configurations except aliases
and ippp devices. It takes precedence over NETMASK when both
PREFIX and NETMASK are set.
Subnet mask; just useful for aliases and ippp devices. For all other
configurations, use PREFIX instead.

The "n" is expected to be consecutive positive integers starting from 0.
It can be omitted if there is only one address being configured.

So I think this explains a lot. In hyperv KVP daemon source there is no logic
to determine if we are going to set more than SINGLE IP address to the interface.
Therefore we have to set the first one as IPADDR0. This is completely OK and
in compliance with the documentation.

> Does that match what the tools consuming the ifcfg-* files expect?

Since the current format looks the same as described in documentation
I assume tools consuming ifcfg-* files expect exactly this. I also checked
scripts handling those ifcfg-* files and they did not expect it to be
IPADDR_n for some "n". We also tested the daemon and it worked just fine.

> Why did it work before this change?

For single IPADDR this should work just fine and it is expected to. But did you
try also to set more than just a single IP address to the interface?

Tomas Hozza
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at