Validate VLAN id on creation

As per IEEE 802.1Q, VLAN ID is a 12-bit unsigned value with 0 and 4095
being reserved. This patch adds check for the VLAN ID when creating
VLAN interface.

Tested:
Creating VLAN with invalid IDs like 0, 4095, 9999 on a valid interface
gives InvalidArgument error.

Change-Id: I27ccd3657b4e411c530762d6076902f22c7cbf5a
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2 files changed
tree: c45f27008e90af8a5dc2f3da280ca65a49da49c6
  1. docs/
  2. gen/
  3. src/
  4. subprojects/
  5. test/
  6. yaml/
  7. .clang-format
  8. .gitignore
  9. .shellcheck
  10. LICENSE
  11. MAINTAINERS
  12. meson.build
  13. meson_options.txt
  14. OWNERS
  15. README.md
  16. xyz.openbmc_project.Network.conf.in
  17. xyz.openbmc_project.Network.service.in
README.md

To Build

To build this package, do the following steps:

    1. meson build
    2. ninja -C build