diff options
author | Gabriel Ganne <gabriel.ganne@enea.com> | 2017-10-11 14:35:55 +0200 |
---|---|---|
committer | Gabriel Ganne <gabriel.ganne@enea.com> | 2017-10-16 09:17:32 +0200 |
commit | f90813d64c4d1aee3a51609e85e632b1f9a37536 (patch) | |
tree | ae193176b6aec75491f2fe356e05f5054f5a1c13 /src/plugins/lb/lb.c | |
parent | 2199aab7422a704f86ca7b8a392531fc42866cb3 (diff) |
lb plugin - fix format() type mismatches
* (vip - lbm->vips) is u64; change format from [%u] to [%lu]
* vip->plen is u8, but format looks for u32; add exlicit cast
(this cast was done implicitely)
On ARM platforms, these prevent a loop in the second call to
format_white_space() which would get an invalid (huge) indent value;
the result *looked like* an infinite loop.
Change-Id: I675ef2f98e4ba3d9e8aef12022d38b1d22981da8
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
Diffstat (limited to 'src/plugins/lb/lb.c')
-rw-r--r-- | src/plugins/lb/lb.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/lb/lb.c b/src/plugins/lb/lb.c index 0bd2ff5d238..fee88056eb4 100644 --- a/src/plugins/lb/lb.c +++ b/src/plugins/lb/lb.c @@ -130,11 +130,12 @@ u8 *format_lb_vip_detailed (u8 * s, va_list * args) lb_vip_t *vip = va_arg (*args, lb_vip_t *); u32 indent = format_get_indent (s); - s = format(s, "%U %U [%u] %U%s\n" + s = format(s, "%U %U [%lu] %U%s\n" "%U new_size:%u\n", format_white_space, indent, format_lb_vip_type, vip->type, - vip - lbm->vips, format_ip46_prefix, &vip->prefix, vip->plen, IP46_TYPE_ANY, + vip - lbm->vips, + format_ip46_prefix, &vip->prefix, (u32) vip->plen, IP46_TYPE_ANY, (vip->flags & LB_VIP_FLAGS_USED)?"":" removed", format_white_space, indent, vip->new_flow_table_mask + 1); |