Do not config Gateway when DHCP is enabled

When DHCP is enabled and the Gateway is in the network config,
systemd-networkd will try to set the gateway anyway, and if the gateway
could not be set, it fails with below error:

 systemd-networkd[459]: eth0: Could not set route: No route to host
 systemd-networkd[459]: eth0: Failed

The config should skip setting the gateway when the DHCP is enabled.

Tested: Verify the DHCP could be enabled from static config.

Fixes openbmc/phosphor-networkd#43

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I6486284133003afbe5c657ef22c27d1994544f17
1 file changed
tree: c91c381ae91c8b89d800d161e5be5336671ee235
  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