]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dhcp6: add an assert()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 12 Jan 2021 13:28:36 +0000 (22:28 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 12 Jan 2021 15:00:56 +0000 (00:00 +0900)
src/libsystemd-network/sd-dhcp6-client.c

index 105d09f334e43bc99456c8f950ca676606fee70c..687661cd5e3ae73ad5eddbccab114bc14155fc2c 100644 (file)
@@ -157,7 +157,6 @@ int sd_dhcp6_client_set_callback(
 }
 
 int sd_dhcp6_client_set_ifindex(sd_dhcp6_client *client, int ifindex) {
-
         assert_return(client, -EINVAL);
         assert_return(ifindex > 0, -EINVAL);
         assert_return(IN_SET(client->state, DHCP6_STATE_STOPPED), -EBUSY);
@@ -351,6 +350,7 @@ int sd_dhcp6_client_duid_as_string(
 
         assert_return(client, -EINVAL);
         assert_return(client->duid_len > 0, -ENODATA);
+        assert_return(duid, -EINVAL);
 
         v = dhcp6_duid_type_to_string(be16toh(client->duid.type));
         if (v) {
@@ -454,7 +454,6 @@ int sd_dhcp6_client_set_request_option(sd_dhcp6_client *client, uint16_t option)
 }
 
 int sd_dhcp6_client_set_request_mud_url(sd_dhcp6_client *client, const char *mudurl) {
-
         assert_return(client, -EINVAL);
         assert_return(client->state == DHCP6_STATE_STOPPED, -EBUSY);
         assert_return(mudurl, -EINVAL);