diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-10-12 12:36:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-12 12:36:47 +0200 |
commit | 6c65a9e1d6b84fec4ff01d0794607377e600b353 (patch) | |
tree | 4b0e256048aecf947f0132f3b11c66322cd09b61 /src/libsystemd-network | |
parent | NEWS: expand on systemd-measure a bit (diff) | |
parent | basic/user-util: simplify variable declarations in fget{pw,gr}ent_sane() (diff) | |
download | systemd-6c65a9e1d6b84fec4ff01d0794607377e600b353.tar.xz systemd-6c65a9e1d6b84fec4ff01d0794607377e600b353.zip |
Merge pull request #24973 from keszybz/simplify-variable-declarations
Simplify variable declarations
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r-- | src/libsystemd-network/dhcp6-option.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/libsystemd-network/dhcp6-option.c b/src/libsystemd-network/dhcp6-option.c index 0b8393ca2c..62873e0111 100644 --- a/src/libsystemd-network/dhcp6-option.c +++ b/src/libsystemd-network/dhcp6-option.c @@ -285,15 +285,13 @@ int dhcp6_option_append_vendor_option(uint8_t **buf, size_t *offset, OrderedSet } static int option_append_ia_address(uint8_t **buf, size_t *offset, const struct iaaddr *address) { - struct iaaddr a; - assert(buf); assert(*buf); assert(offset); assert(address); /* Do not append T1 and T2. */ - a = (struct iaaddr) { + const struct iaaddr a = { .address = address->address, }; @@ -301,8 +299,6 @@ static int option_append_ia_address(uint8_t **buf, size_t *offset, const struct } static int option_append_pd_prefix(uint8_t **buf, size_t *offset, const struct iapdprefix *prefix) { - struct iapdprefix p; - assert(buf); assert(*buf); assert(offset); @@ -312,7 +308,7 @@ static int option_append_pd_prefix(uint8_t **buf, size_t *offset, const struct i return -EINVAL; /* Do not append T1 and T2. */ - p = (struct iapdprefix) { + const struct iapdprefix p = { .prefixlen = prefix->prefixlen, .address = prefix->address, }; |