]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-ipv4acd: do not define ether_addr_is_nul() redundantly
authorLennart Poettering <lennart@poettering.net>
Sun, 22 May 2016 12:26:06 +0000 (14:26 +0200)
committerLennart Poettering <lennart@poettering.net>
Sun, 22 May 2016 12:26:06 +0000 (14:26 +0200)
we already have ether_addr_is_null() in ether-addr-util.h, let's use it here,
too.

src/libsystemd-network/sd-ipv4acd.c

index c336c6a62da7a248dc824975ac70023a12ce139c..68563ad4233aa5efc867bf65b1556085edcaf5de 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "alloc-util.h"
 #include "arp-util.h"
+#include "ether-addr-util.h"
 #include "fd-util.h"
 #include "in-addr-util.h"
 #include "list.h"
@@ -472,14 +473,6 @@ int sd_ipv4acd_is_running(sd_ipv4acd *ll) {
         return ll->state != IPV4ACD_STATE_INIT;
 }
 
-static bool ether_addr_is_nul(const struct ether_addr *addr) {
-        const struct ether_addr nul_addr = {};
-
-        assert(addr);
-
-        return memcmp(addr, &nul_addr, sizeof(struct ether_addr)) == 0;
-}
-
 int sd_ipv4acd_start(sd_ipv4acd *ll) {
         int r;
 
@@ -487,7 +480,7 @@ int sd_ipv4acd_start(sd_ipv4acd *ll) {
         assert_return(ll->event, -EINVAL);
         assert_return(ll->index > 0, -EINVAL);
         assert_return(ll->address != 0, -EINVAL);
-        assert_return(!ether_addr_is_nul(&ll->mac_addr), -EINVAL);
+        assert_return(!ether_addr_is_null(&ll->mac_addr), -EINVAL);
         assert_return(ll->state == IPV4ACD_STATE_INIT, -EBUSY);
 
         ll->defend_window = 0;