diff options
author | Yasuhiro Nakamura <yanakamu@yahoo-corp.jp> | 2020-02-17 13:03:38 +0900 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2020-08-13 08:12:25 +0000 |
commit | c285f384ff25a7249e51ac91374ad8945923fcb6 (patch) | |
tree | fd8b7da3791d3dda4f2eb061434dc4981d7176fe /src/plugins | |
parent | 5a9769c159a8bd7163035c6e12abe87668674ff3 (diff) |
lb: Fix generating illegal key in per-port vip
VIP prefix index becomes always 0 when adding a VIP which is already registered different port, causing LB config crash.
This change assigns the same VIP prefix index to the same VIP.
Ticket: https://jira.fd.io/browse/VPP-1834
Type: fix
Signed-off-by: Yasuhiro Nakamura <yanakamu@yahoo-corp.jp>
Change-Id: Ib63b3e58db9bd85714d68cd1292aadd0c8580da8
(cherry picked from commit 551775eaaa9c162c73e15690e4d7580935e9a70a)
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lb/lb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/lb/lb.c b/src/plugins/lb/lb.c index b1e0b237478..6c9ae605ceb 100644 --- a/src/plugins/lb/lb.c +++ b/src/plugins/lb/lb.c @@ -903,6 +903,8 @@ static void lb_vip_add_adjacency(lb_main_t *lbm, lb_vip_t *vip, if (!lb_vip_port_find_diff_port(&(vip->prefix), vip->plen, vip->protocol, vip->port, &vip_idx)) { + lb_vip_t *exists_vip = lb_vip_get_by_index(vip_idx); + *vip_prefix_index = exists_vip->vip_prefix_index; return; } |