]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: use IN_SET() macro 17692/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 23 Nov 2020 13:34:43 +0000 (22:34 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 30 Nov 2020 03:41:41 +0000 (12:41 +0900)
Follow-up for 1d370b2c182505ff8033fccbebcc56621d305220.

src/network/networkd-dhcp-common.c

index c338c775a72be24acde8a287b6f22332fecad8b4..904cb34d1321a85b881eb1ae2feee2eee85bec46 100644 (file)
@@ -62,11 +62,9 @@ static struct DUID fallback_duid = { .type = DUID_TYPE_EN };
 DUID* link_get_duid(Link *link) {
         if (link->network->duid.type != _DUID_TYPE_INVALID)
                 return &link->network->duid;
-        else if (link->hw_addr.length == 0 &&
-                 (link->manager->duid.type == DUID_TYPE_LLT ||
-                  link->manager->duid.type == DUID_TYPE_LL))
-                /* Fallback to DUID that works without mac addresses.
-                 * This is useful for tunnel devices without mac address. */
+        else if (link->hw_addr.length == 0 && IN_SET(link->manager->duid.type, DUID_TYPE_LLT, DUID_TYPE_LL))
+                /* Fallback to DUID that works without MAC address.
+                 * This is useful for tunnel devices without MAC address. */
                 return &fallback_duid;
         else
                 return &link->manager->duid;