[PATCH 0/5] VLAN support for NetworkManager(V3)



This patchset is to add vlan support for NetworkManager,
based on nm/bonding branch, commit 6b1d0ca510d2(bonding:
don't fall back to DHCP if IP config is missing).

Requires libnl-3.2.1

FEATURE DESCRIPTION
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.

vlan=yes
TYPE=vlan
DEVICE=vlan43 or DEVICE=eth9.43
PHYSDEV=eth9
REORDER_HDR=0
vlan_FLAGS=GVRP,LOOSE_BINDING
vlan_INGRESS_PRIORITY_MAP=0:1,2:5
vlan_EGRESS_PRIORITY_MAP=12:3,14:7
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.43.149
NETMASK=255.255.255.0

2 create and delete vlan device
We use libnl to create and delete vlan device in kernel.

3 support both static IP configuration and DHCP for vlan device

TODO
1 accept MAC address or NM connection UUID as PHYSDEV

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.

Changelog:
V3:
1 parse format "DEVICE=eth9.43"
2 modify NMSettingVlan->get_property()
3 call nm_system_add_vlan_device() to create vlan device in kernel

V2:
1 rebase on nm/bonding branch
2 use "vlan" or "Vlan" instead of "VLAN" for consistency.
3 use GSList to store vlan ingress/egress priority map.
4 add enum NMVlanFlags.
5 delete NMDeviceVLAN, just use NMDeviceEthernet.
6 add ifcfg-vlan writer

Weiping Pan (5):
  configure: use correct if defined
  vlan: add ifcfg-vlan parser
  vlan: create/delete kernel vlan device
  vlan: create NMDeviceEthernet for vlan device
  vlan: add ifcfg-vlan writer

 libnm-util/Makefile.am                             |    2 +
 libnm-util/libnm-util.ver                          |   11 +
 libnm-util/nm-connection.c                         |   26 +-
 libnm-util/nm-connection.h                         |    2 +
 libnm-util/nm-setting-vlan.c                       |  601 ++++++++++++++++++++
 libnm-util/nm-setting-vlan.h                       |  118 ++++
 src/nm-device-ethernet.c                           |   34 +-
 src/nm-device-ethernet.h                           |    1 +
 src/nm-manager.c                                   |   11 +
 src/nm-netlink-compat.h                            |    2 +-
 src/nm-system.c                                    |  156 +++++
 src/nm-system.h                                    |    5 +-
 src/nm-udev-manager.c                              |    4 +-
 src/settings/nm-settings.c                         |    9 +
 src/settings/plugins/ifcfg-rh/common.h             |    1 +
 src/settings/plugins/ifcfg-rh/reader.c             |  193 ++++++-
 .../network-scripts/ifcfg-test-vlan-interface      |   11 +-
 .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c         |   41 ++-
 src/settings/plugins/ifcfg-rh/writer.c             |   90 +++
 19 files changed, 1293 insertions(+), 25 deletions(-)
 create mode 100644 libnm-util/nm-setting-vlan.c
 create mode 100644 libnm-util/nm-setting-vlan.h

-- 
1.7.4.4



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