chiark / gitweb /
networkd: introduce an AddressFamilyBoolean enum type
[elogind.git] / src / network / networkd-dhcp4.c
index 0a8c8ba8e452b862ab6e3144ee406c8971c00f41..c3d0e3d39d621a06ce4133d8c431373fbeba6c1b 100644 (file)
@@ -296,11 +296,8 @@ static int dhcp4_address_handler(sd_rtnl *rtnl, sd_rtnl_message *m,
                 log_link_error(link, "could not set DHCPv4 address: %s",
                                strerror(-r));
                 link_enter_failed(link);
-        } else if (r >= 0) {
-                /* calling handler directly so take a ref */
-                link_ref(link);
-                link_get_address_handler(rtnl, m, link);
-        }
+        } else if (r >= 0)
+                link_rtnl_process_address(rtnl, m, link->manager);
 
         link_set_dhcp_routes(link);
 
@@ -442,7 +439,7 @@ static int dhcp_lease_acquired(sd_dhcp_client *client, Link *link) {
         }
 
         if (r >= 0)
-                log_link_struct(LOG_INFO, link,
+                log_link_struct(link, LOG_INFO,
                                 "MESSAGE=%-*s: DHCPv4 address %u.%u.%u.%u/%u via %u.%u.%u.%u",
                                  IFNAMSIZ,
                                  link->ifname,
@@ -457,7 +454,7 @@ static int dhcp_lease_acquired(sd_dhcp_client *client, Link *link) {
                                  ADDRESS_FMT_VAL(gateway),
                                  NULL);
         else
-                log_link_struct(LOG_INFO, link,
+                log_link_struct(link, LOG_INFO,
                                 "MESSAGE=%-*s: DHCPv4 address %u.%u.%u.%u/%u",
                                  IFNAMSIZ,
                                  link->ifname,
@@ -589,7 +586,7 @@ int dhcp4_configure(Link *link) {
 
         assert(link);
         assert(link->network);
-        assert(IN_SET(link->network->dhcp, DHCP_SUPPORT_BOTH, DHCP_SUPPORT_V4));
+        assert(IN_SET(link->network->dhcp, ADDRESS_FAMILY_YES, ADDRESS_FAMILY_IPV4));
 
         r = sd_dhcp_client_new(&link->dhcp_client);
         if (r < 0)