mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-10 08:10:22 +01:00
sd-dhcp6: coding style cleanups
(cherry picked from commit da07cf358231caca214da5d4f161b06e713586be)
This commit is contained in:
parent
373cbfc8c6
commit
a7137ce0ce
1 changed files with 10 additions and 7 deletions
|
|
@ -837,10 +837,11 @@ static int client_parse_message(
|
|||
DHCP6Message *message,
|
||||
size_t len,
|
||||
sd_dhcp6_lease *lease) {
|
||||
|
||||
uint32_t lt_t1 = ~0, lt_t2 = ~0;
|
||||
bool clientid = false;
|
||||
size_t pos = 0;
|
||||
int r;
|
||||
bool clientid = false;
|
||||
uint32_t lt_t1 = ~0, lt_t2 = ~0;
|
||||
|
||||
assert(client);
|
||||
assert(message);
|
||||
|
|
@ -850,20 +851,22 @@ static int client_parse_message(
|
|||
len -= sizeof(DHCP6Message);
|
||||
|
||||
while (pos < len) {
|
||||
DHCP6Option *option = (DHCP6Option *)&message->options[pos];
|
||||
DHCP6Option *option = (DHCP6Option *) &message->options[pos];
|
||||
uint16_t optcode, optlen;
|
||||
int status;
|
||||
uint8_t *optval;
|
||||
be32_t iaid_lease;
|
||||
uint8_t *optval;
|
||||
int status;
|
||||
|
||||
if (len < pos + offsetof(DHCP6Option, data) ||
|
||||
len < pos + offsetof(DHCP6Option, data) + be16toh(option->len))
|
||||
if (len < pos + offsetof(DHCP6Option, data))
|
||||
return -ENOBUFS;
|
||||
|
||||
optcode = be16toh(option->code);
|
||||
optlen = be16toh(option->len);
|
||||
optval = option->data;
|
||||
|
||||
if (len < pos + offsetof(DHCP6Option, data) + optlen)
|
||||
return -ENOBUFS;
|
||||
|
||||
switch (optcode) {
|
||||
case SD_DHCP6_OPTION_CLIENTID:
|
||||
if (clientid) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue