Skip to content

Commit

Permalink
lib/pb-protocol: fix ordering of system info length calculation
Browse files Browse the repository at this point in the history
... to match the definition of struct system_info.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
  • Loading branch information
jk-ozlabs committed Jan 23, 2020
1 parent 057dce2 commit 6ee9cbc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/pb-protocol/pb-protocol.c
Expand Up @@ -253,6 +253,9 @@ int pb_protocol_system_info_len(const struct system_info *sysinfo)
for (i = 0; i < sysinfo->n_bmc_golden; i++)
len += 4 + optional_strlen(sysinfo->bmc_golden[i]);

/* BMC MAC */
len += HWADDR_SIZE;

for (i = 0; i < sysinfo->n_interfaces; i++) {
struct interface_info *if_info = sysinfo->interfaces[i];
len += 4 + if_info->hwaddr_size +
Expand All @@ -269,9 +272,6 @@ int pb_protocol_system_info_len(const struct system_info *sysinfo)
4 + optional_strlen(bd_info->mountpoint);
}

/* BMC MAC */
len += HWADDR_SIZE;

return len;
}

Expand Down

0 comments on commit 6ee9cbc

Please sign in to comment.