Klaus Heinrich Kiwi | d1cd8c5 | 2020-02-27 12:43:47 -0300 | [diff] [blame] | 1 | From 74226ad7cbb0c2a5b4e9fa3c0de6335a2540952e Mon Sep 17 00:00:00 2001 |
| 2 | From: Jeremy Kerr <jk@ozlabs.org> |
| 3 | Date: Wed, 20 Nov 2019 12:20:43 +0800 |
| 4 | Subject: [PATCH 18/18] lib/pb-protocol: fix ordering of system info length |
| 5 | calculation |
| 6 | |
| 7 | ... to match the definition of struct system_info. |
| 8 | |
| 9 | Signed-off-by: Jeremy Kerr <jk@ozlabs.org> |
| 10 | (cherry picked from commit 6ee9cbcb1bd6ef9fbf1a56322e3fe2fa2646159c) |
| 11 | Signed-off-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com> |
| 12 | --- |
| 13 | lib/pb-protocol/pb-protocol.c | 6 +++--- |
| 14 | 1 file changed, 3 insertions(+), 3 deletions(-) |
| 15 | |
| 16 | diff --git a/lib/pb-protocol/pb-protocol.c b/lib/pb-protocol/pb-protocol.c |
| 17 | index daf4ec9..e0cef36 100644 |
| 18 | --- a/lib/pb-protocol/pb-protocol.c |
| 19 | +++ b/lib/pb-protocol/pb-protocol.c |
| 20 | @@ -253,6 +253,9 @@ int pb_protocol_system_info_len(const struct system_info *sysinfo) |
| 21 | for (i = 0; i < sysinfo->n_bmc_golden; i++) |
| 22 | len += 4 + optional_strlen(sysinfo->bmc_golden[i]); |
| 23 | |
| 24 | + /* BMC MAC */ |
| 25 | + len += HWADDR_SIZE; |
| 26 | + |
| 27 | for (i = 0; i < sysinfo->n_interfaces; i++) { |
| 28 | struct interface_info *if_info = sysinfo->interfaces[i]; |
| 29 | len += 4 + if_info->hwaddr_size + |
| 30 | @@ -269,9 +272,6 @@ int pb_protocol_system_info_len(const struct system_info *sysinfo) |
| 31 | 4 + optional_strlen(bd_info->mountpoint); |
| 32 | } |
| 33 | |
| 34 | - /* BMC MAC */ |
| 35 | - len += HWADDR_SIZE; |
| 36 | - |
| 37 | return len; |
| 38 | } |
| 39 | |
| 40 | -- |
| 41 | 2.17.1 |
| 42 | |