diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-10-12 09:18:24 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-10-12 09:18:24 +0200 |
commit | 59818f4381fe7d0cfebfa1f7b79d8c1d93efeb92 (patch) | |
tree | d4572ee366848599ecca9251eb32cc5f9d38efaa /src/libsystemd-network | |
parent | sd-dhcp6-client: allow to build large packet (diff) | |
download | systemd-59818f4381fe7d0cfebfa1f7b79d8c1d93efeb92.tar.xz systemd-59818f4381fe7d0cfebfa1f7b79d8c1d93efeb92.zip |
libsystemd-network: trivial simplification
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, }; |