aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lb/api.c
diff options
context:
space:
mode:
authorHongjun Ni <hongjun.ni@intel.com>2019-11-26 19:36:17 +0800
committerDamjan Marion <dmarion@me.com>2019-11-26 09:49:23 +0000
commite69f4714323e1f7e7754fef58a2d75949e146317 (patch)
treed3d4f6f495102600220fc1fb15f87e085d21c1d8 /src/plugins/lb/api.c
parent30cca512ce3818a9b2c56140f7859bd544bc825d (diff)
lb: lb_add_del_vip and lb_add_del_as doesn't work.
Ticket: FDIO-753 Type: fix Change-Id: I4a8cf06970b658dfa15768459a3ff76571d6dfff Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
Diffstat (limited to 'src/plugins/lb/api.c')
-rw-r--r--src/plugins/lb/api.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/plugins/lb/api.c b/src/plugins/lb/api.c
index 67a26d54902..bef6969ed84 100644
--- a/src/plugins/lb/api.c
+++ b/src/plugins/lb/api.c
@@ -93,7 +93,7 @@ vl_api_lb_add_del_vip_t_handler
mp->protocol = ~0;
}
- ip_address_decode (&mp->pfx.address, &(args.prefix));
+ memcpy (&(args.prefix.ip6), &mp->pfx.address.un.ip6, sizeof(args.prefix.ip6));
if (mp->is_del) {
u32 vip_index;
@@ -183,10 +183,20 @@ vl_api_lb_add_del_as_t_handler
int rv = 0;
u32 vip_index;
ip46_address_t vip_ip_prefix;
+
+ /* if port == 0, it means all-port VIP */
+ if (mp->port == 0)
+ {
+ mp->protocol = ~0;
+ }
+
+ memcpy(&vip_ip_prefix.ip6, &mp->pfx.address.un.ip6,
+ sizeof(vip_ip_prefix.ip6));
+
ip46_address_t as_address;
- ip_address_decode (&mp->pfx.address, &vip_ip_prefix);
- ip_address_decode (&mp->as_address, &as_address);
+ memcpy(&as_address.ip6, &mp->as_address.un.ip6,
+ sizeof(as_address.ip6));
if ((rv = lb_vip_find_index(&vip_ip_prefix, mp->pfx.len,
mp->protocol, ntohs(mp->port), &vip_index)))