]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dhcp6: do not append ORO option when no option requested 24299/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 13 Aug 2022 17:43:51 +0000 (02:43 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 13 Aug 2022 17:44:52 +0000 (02:44 +0900)
Fixes #24292.

src/libsystemd-network/sd-dhcp6-client.c

index 0727050ed2d80aa827e110d161c2682ff22194a6..26114900677cd04f0a88ab2a8f8bed4c40d00711 100644 (file)
@@ -690,6 +690,9 @@ static int client_append_oro(sd_dhcp6_client *client, uint8_t **opt, size_t *opt
                 req_opts = client->req_opts;
         }
 
+        if (n == 0)
+                return 0;
+
         return dhcp6_option_append(opt, optlen, SD_DHCP6_OPTION_ORO, n * sizeof(be16_t), req_opts);
 }