phosphor-networkd: write down the config when GW changes

We saw issues when gateway is set in phosphor networkd but not in the
systemd config files. This will ensure that systemd is in sync with
phosphor networkd when gateway changes.

Change-Id: Iff2ddd8cd4ee7eb5935adb59dcb9ab7a4b170795
Signed-off-by: Yuxiao Zhang <yuxiaozhang@google.com>
diff --git a/src/ethernet_interface.cpp b/src/ethernet_interface.cpp
index f92c31c..14a7e73 100644
--- a/src/ethernet_interface.cpp
+++ b/src/ethernet_interface.cpp
@@ -882,6 +882,7 @@
     if (gateway != defaultGateway())
     {
         gateway = EthernetInterfaceIntf::defaultGateway(std::move(gateway));
+        writeConfigurationFile();
         manager.get().reloadConfigs();
     }
     return gateway;
@@ -893,6 +894,7 @@
     if (gateway != defaultGateway6())
     {
         gateway = EthernetInterfaceIntf::defaultGateway6(std::move(gateway));
+        writeConfigurationFile();
         manager.get().reloadConfigs();
     }
     return gateway;