[PATCH 0/6] VLAN support for NetworkManager(V1)

This patchset is to add VLAN support for NetworkManager,
based on 6e92c1b60616(core: fix leaked return value of

Requires libnl-3.2.1

1 example of VLAN ifcfg file
We try to make it compitable with the format used by initscripts,
and there is no need to change anything for ifcfg-eth9.


2 NMDeviceVLAN 
NMDeviceVLAN inherits NMDevice and it implements functions of
NMDeviceClass. And it also implements some functions for

NetworkManager can parse VLAN ifcfg file and create corresponding VLAN device,
and create NMDeviceVLAN objects for them.
And it can also recognize existing VLAN devices created by vconfig,
and will also create corresponding NMDeviceVLAN objects.

3 create and delete VLAN device
We use libnl to create and delete VLAN device in kernel.

4 support both static IP configuration and DHCP for VLAN device

1 set ingress and egress priority mapping for NMDeviceVLAN
Now the VLAN parser can get ingress and egress priority mapping from the
ifcfg file, and they are used to create VLAN device in kernel, 
but now NetworkManager doesn't use them when creating corresponding
NMDeviceVLAN object.

2 activating dependency
Before activating a VLAN device, we should make sure that the underlying
physical ethernet device is up.
For example, before activating eth0.100, we should make sure that eth0 is up.
NetworkManager calls g_udev_client_query_by_subsystem() to get the device
list, and then activates each devices on that device list.
And luckily I found that the physical ethernet device is prior to VLAN device
on that device list, so there is nothing to do to make sure the activating
sequence between a VLAN device and its underlying physical ethernet device.

Maybe we should not rely on the behavior of
g_udev_client_query_by_subsystem(), and we should add special restriction to
make sure that before activating a VLAN device, the underlying physical 
ethernet device is up.

Thomas Graf (1):
  connection: Add nm_connection_is_type()

Weiping Pan (5):
  VLAN: add ifcfg-vlan parser
  VLAN: create/delete kernel vlan device
  VLAN: add NMDeviceVLAN
  VLAN: create virtual kernel devices
  VLAN: create NMDeviceVLAN and activate it

 include/NetworkManager.h                           |    1 +
 libnm-util/Makefile.am                             |    2 +
 libnm-util/libnm-util.ver                          |   12 +
 libnm-util/nm-connection.c                         |   40 +++-
 libnm-util/nm-connection.h                         |    4 +
 libnm-util/nm-setting-vlan.c                       |  351 ++++++++++++++++++++
 libnm-util/nm-setting-vlan.h                       |   93 +++++
 src/Makefile.am                                    |    2 +
 src/nm-device-vlan.c                               |  330 ++++++++++++++++++
 src/nm-device-vlan.h                               |   59 ++++
 src/nm-manager.c                                   |   84 +++++-
 src/nm-system.c                                    |  265 +++++++++++++++
 src/nm-system.h                                    |    4 +
 src/nm-udev-manager.c                              |  105 ++++++-
 src/settings/plugins/ifcfg-rh/common.h             |    1 +
 src/settings/plugins/ifcfg-rh/reader.c             |  143 ++++++++-
 .../network-scripts/ifcfg-test-vlan-interface      |   11 +-
 17 files changed, 1484 insertions(+), 23 deletions(-)
 create mode 100644 libnm-util/nm-setting-vlan.c
 create mode 100644 libnm-util/nm-setting-vlan.h
 create mode 100644 src/nm-device-vlan.c
 create mode 100644 src/nm-device-vlan.h


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]