Block creating IPv4 address 0.0.0.0 via Set LAN Configuration

The IPMI Set LAN Configuration IP Address operation allows any 32-bit
value to be sent to addressed NIC. The current OpenBMC behavior is to
treat all values identically, and insert them into the
systemd-networkd configuration file. This only allows IPMI to write
new values, but to never have a way to remove an entry.

Traditionally IPMI has used 0.0.0.0 to remove a static IP address
entry from being applied to the NIC. This commit implements the
ability to remove an active static IPv4 address by assigning 0.0.0.0
to the NIC.

Preventing 0.0.0.0 from being written to the systemd-networkd
configuration file also prevents systemd-networkd from creating one or
more self assigned 192.x.x.x NAT style addresses.

Tested:
Manually inserted several 'Address=' entries containing valid IPv4
addresses. Rebooted the BMC to enable them.
Issued 'ipmitool raw 12 1 1 3 0 0 0 0' and confirmed no
'Address=0.0.0.0' entry was added to the configuration file.
Confirmed no self assigned NAT addresses were created.
Confirmed one static IPv4 address entry was removed from the config
file.
Repeated 'ipmitool' requests removed one static address per request.

Change-Id: I2ae94750b8f7b80d45b94651464477801064f991
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
diff --git a/transporthandler.cpp b/transporthandler.cpp
index 40ef88f..61960d2 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -388,8 +388,12 @@
         fallbackPrefix = ifaddr->prefix;
         deleteObjectIfExists(bus, params.service, ifaddr->path);
     }
-    createIfAddr<AF_INET>(bus, params, address.value_or(ifaddr->address),
-                          prefix.value_or(fallbackPrefix));
+
+    if (struct in_addr nullIPv4{0}; address.value().s_addr != nullIPv4.s_addr)
+    {
+        createIfAddr<AF_INET>(bus, params, address.value_or(ifaddr->address),
+                              prefix.value_or(fallbackPrefix));
+    }
 }
 
 template <int family>