lb: vl_api_lb_conf_t_handler has to ntohl 49/22149/5
authorVratko Polak <vrpolak@cisco.com>
Fri, 20 Sep 2019 16:23:58 +0000 (18:23 +0200)
committerAndrew Yourtchenko <ayourtch@gmail.com>
Thu, 26 Sep 2019 07:05:54 +0000 (07:05 +0000)
As requested in review, this is a minimal edit.
Refactor comes as a separate Change.

Type: fix

Change-Id: Ie3bdfc3cfde4bfee56848217133ca5f6bbccaeef
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
src/plugins/lb/api.c

index 5354179..0543720 100644 (file)
@@ -78,16 +78,16 @@ vl_api_lb_conf_t_handler
   int rv = 0;
 
   if (mp->sticky_buckets_per_core == ~0) {
-    mp->sticky_buckets_per_core = lbm->per_cpu_sticky_buckets;
+    mp->sticky_buckets_per_core = htonl(lbm->per_cpu_sticky_buckets);
   }
   if (mp->flow_timeout == ~0) {
-    mp->flow_timeout = lbm->flow_timeout;
+    mp->flow_timeout = htonl(lbm->flow_timeout);
   }
 
   rv = lb_conf((ip4_address_t *)&mp->ip4_src_address,
                (ip6_address_t *)&mp->ip6_src_address,
-               mp->sticky_buckets_per_core,
-               mp->flow_timeout);
+               ntohl(mp->sticky_buckets_per_core),
+               ntohl(mp->flow_timeout));
 
  REPLY_MACRO (VL_API_LB_CONF_REPLY);
 }