summaryrefslogtreecommitdiffstats
path: root/src/plugins/lb/api.c
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-03-19 11:54:39 -0700
committerOle Trøan <otroan@employees.org>2019-03-22 08:30:11 +0000
commitf7f13347bc8bc941a2d9aa847ddd88a758d65f71 (patch)
tree4dae0b0ad0c9216eb5de75384f7fb0348b7d9dc1 /src/plugins/lb/api.c
parentbdd6e6ac4ebde344adeb3f7c78c4b2031a0eb52a (diff)
tests: update test_lb.py to use api call lb_conf.
Change-Id: I96a1d4b2b3ae22cf164c0acd6db9b323cd70f51a Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src/plugins/lb/api.c')
-rw-r--r--src/plugins/lb/api.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/plugins/lb/api.c b/src/plugins/lb/api.c
index 07476be70fd..953654cd956 100644
--- a/src/plugins/lb/api.c
+++ b/src/plugins/lb/api.c
@@ -16,6 +16,7 @@
#include <lb/lb.h>
#include <vppinfra/byte_order.h>
+#include <vppinfra/string.h>
#include <vlibapi/api.h>
#include <vlibapi/api.h>
#include <vlibmemory/api.h>
@@ -79,8 +80,15 @@ vl_api_lb_conf_t_handler
vl_api_lb_conf_reply_t * rmp;
int rv = 0;
+ if (mp->sticky_buckets_per_core == ~0) {
+ mp->sticky_buckets_per_core = lbm->per_cpu_sticky_buckets;
+ }
+ if (mp->flow_timeout == ~0) {
+ mp->flow_timeout = lbm->flow_timeout;
+ }
+
rv = lb_conf((ip4_address_t *)&mp->ip4_src_address,
- (ip6_address_t *)mp->ip6_src_address,
+ (ip6_address_t *)&mp->ip6_src_address,
mp->sticky_buckets_per_core,
mp->flow_timeout);
@@ -93,7 +101,7 @@ static void *vl_api_lb_conf_t_print
u8 * s;
s = format (0, "SCRIPT: lb_conf ");
s = format (s, "%U ", format_ip4_address, (ip4_address_t *)&mp->ip4_src_address);
- s = format (s, "%U ", format_ip6_address, (ip6_address_t *)mp->ip6_src_address);
+ s = format (s, "%U ", format_ip6_address, (ip6_address_t *)&mp->ip6_src_address);
s = format (s, "%u ", mp->sticky_buckets_per_core);
s = format (s, "%u ", mp->flow_timeout);
FINISH;