ethernet: Add origin to generateId()

Currently the code uses the ip address, prefix, and gateway to generate
the ID of the DBus object.
This results in the same DBus object path for the same IPs while they
have different address origin.
E.g. if we have the DHCP address and assign the same static address, the
DBus object paths are the same and it gets
`org.freedesktop.DBus.Error.FileExists` exception while creating the new
object.

Add origin to generateId() so they generate the two different object
paths and the above issue could be fixed.

Tested: Verify in QEMU that setting static IP is OK from DHCP.

Fixes openbmc/phosphor-networkd#41

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: Iafe94cedff7e39490386be7777f3d975f1cf6b3f
3 files changed
tree: da6b63758f6c69d04b6b9d07b6bc04bb1e6b2c67
  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. README.md
  15. xyz.openbmc_project.Network.conf.in
  16. 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