summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network/test-dhcp-option.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-12-08 10:06:49 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-12-08 10:13:44 +0100
commit74e2e548960b6ca6dd3e599cd47727c7b7023ff0 (patch)
tree878fd3b15627c204aef4a82d4002fcaa2638aa73 /src/libsystemd-network/test-dhcp-option.c
parentkernel-install: respect $MACHINE_ID and ignore /etc/machine-id if on tmpfs (diff)
downloadsystemd-74e2e548960b6ca6dd3e599cd47727c7b7023ff0.tar.xz
systemd-74e2e548960b6ca6dd3e599cd47727c7b7023ff0.zip
test-dhcp-option: rename variable to avoid global/local name conflict
CodeQL was complaining that the local variable obscurs the global one. It is indeed a bit confusing when reading this… Let's rename the variable to avoid confusing the reader.
Diffstat (limited to 'src/libsystemd-network/test-dhcp-option.c')
-rw-r--r--src/libsystemd-network/test-dhcp-option.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libsystemd-network/test-dhcp-option.c b/src/libsystemd-network/test-dhcp-option.c
index c4a0d4ccb2..2c82ac982d 100644
--- a/src/libsystemd-network/test-dhcp-option.c
+++ b/src/libsystemd-network/test-dhcp-option.c
@@ -278,7 +278,7 @@ static void test_option_removal(struct option_desc *desc) {
assert_se(dhcp_option_parse(message, sizeof(DHCPMessage) + desc->len, NULL, NULL, NULL) < 0);
}
-static uint8_t options[64] = {
+static uint8_t the_options[64] = {
'A', 'B', 'C', 'D',
160, 2, 0x11, 0x12,
0,
@@ -316,16 +316,16 @@ static void test_option_set(void) {
offset = pos = 4;
len = 11;
- while (pos < len && options[pos] != SD_DHCP_OPTION_END) {
+ while (pos < len && the_options[pos] != SD_DHCP_OPTION_END) {
assert_se(dhcp_option_append(result, len, &offset, DHCP_OVERLOAD_SNAME,
- options[pos],
- options[pos + 1],
- &options[pos + 2]) >= 0);
+ the_options[pos],
+ the_options[pos + 1],
+ &the_options[pos + 2]) >= 0);
- if (options[pos] == SD_DHCP_OPTION_PAD)
+ if (the_options[pos] == SD_DHCP_OPTION_PAD)
pos++;
else
- pos += 2 + options[pos + 1];
+ pos += 2 + the_options[pos + 1];
if (pos < len)
assert_se(offset == pos);
@@ -334,8 +334,8 @@ static void test_option_set(void) {
for (i = 0; i < 9; i++) {
if (verbose)
printf("%2u: 0x%02x(0x%02x) (options)\n", i, result->options[i],
- options[i]);
- assert_se(result->options[i] == options[i]);
+ the_options[i]);
+ assert_se(result->options[i] == the_options[i]);
}
if (verbose)
@@ -353,8 +353,8 @@ static void test_option_set(void) {
for (i = 0; i < pos - 8; i++) {
if (verbose)
printf("%2u: 0x%02x(0x%02x) (sname)\n", i, result->sname[i],
- options[i + 9]);
- assert_se(result->sname[i] == options[i + 9]);
+ the_options[i + 9]);
+ assert_se(result->sname[i] == the_options[i + 9]);
}
if (verbose)