[netcf-devel] [PATCH] Allow IPv4 static addresses simultaneous with DHCP

Eric Blake eblake at redhat.com
Mon Apr 6 16:14:05 UTC 2015


On 03/30/2015 03:07 PM, Laine Stump wrote:
> Because initscripts network startup ends up ignoring static IPv4
> addresses when dhcp is enabled (BOOTPROTO=dhcp in the ifcfg file) and
> because at least some of the frontends to Network Manager disable
> configuring a static address if dhcp is enabled (and likely due to
> other indications, but this all happened far in the past...) netcf has
> always made DHCP and static IP addresses for IPv4 mutually exclusive
> in the config - an interface either had one or it had the other.
> 

> In the end, any time that all three address types for IPv6 (autoconf,
> dhcp, static) or two address types for IPv4 (dhcp, static) cannot work
> simultaneously on the same interface, that is a bug in the networking
> backend (e.g. initscripts, NetworkManager), *not* a reason to disallow
> such configurations via netcf.
> 
> For that reason, this patch opens up the RNG for the IPv4 protocol,
> allowing <dhcp/> to be specified simultaneously with any number of
> static <ip> elements for IPv4, just as we already did for IPv6. Any
> future failures of such configurations to work properly should result
> in bugs filed against the network backend in use at the time (or
> possibly the dhcp server, or some other piece of infrastructure).
> ---
>  data/xml/interface.rng                             | 28 ++++++-------
>  data/xml/redhat-get.xsl                            | 48 +++++++++++-----------
>  data/xml/redhat-put.xsl                            | 14 +++----
>  tests/interface/bridge-multi-all.xml               | 23 +++++++++++
>  .../fsroot/etc/sysconfig/network-scripts/ifcfg-br2 | 25 +++++++++++
>  tests/redhat/schema/bridge-multi-all.xml           | 30 ++++++++++++++
>  tests/test-redhat.c                                |  3 +-
>  7 files changed, 123 insertions(+), 48 deletions(-)
>  create mode 100644 tests/interface/bridge-multi-all.xml
>  create mode 100644 tests/redhat/fsroot/etc/sysconfig/network-scripts/ifcfg-br2
>  create mode 100644 tests/redhat/schema/bridge-multi-all.xml
> 

ACK

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <https://lists.fedorahosted.org/pipermail/netcf-devel/attachments/20150406/23196dd8/attachment.sig>


More information about the netcf-devel mailing list