Page MenuHomePhabricator

`set load-balancing wan rule 0` causes segfault and prevents load balancing from starting
Open, Requires assessmentPublic

Description

Hi,

(I would like to submit patches to fix this, but would first like to know whether I should update the documentation and command help text to reflect that 0 is an invalid rule ID, or if I should fix the segfault when 0 is used as a rule number.)

The documentation suggests using rule 0 for the load balancing rule.

The command help text suggests 0 is a valid rule number

vyos@vyos# set rule 
Possible completions:
 > <0-4294967295>
                Rule number

But, the code suggests that rule 0 is not valid.

And, more importantly, using rule 0 causes a segfault in wan_lb, preventing the load balancing system from ever working.

Starting out with this configuration:

set load-balancing wan interface-health eth0v11 nexthop '10.0.0.1'
set load-balancing wan interface-health eth0v12 nexthop '10.0.0.1'
set load-balancing wan rule 10 inbound-interface 'eth0.75'
set load-balancing wan rule 10 interface eth0v11
set load-balancing wan rule 10 interface eth0v12

The above configuration works as expected. I can then add a rule 0 to induce the problem.

[edit load-balancing wan]
vyos@vyos# set rule 0 inbound-interface eth0.75
[edit load-balancing wan]
vyos@vyos# set rule 0 interface eth0
[edit load-balancing wan]
vyos@vyos# commit
[edit load-balancing wan]
vyos@vyos# run show wan-load-balance 
WAN load balancing is not configured    <----- WLB is now unavailable
[edit load-balancing wan]
vyos@vyos# /opt/vyatta/sbin/wan_lb -f /var/run/load-balance/wlb.conf  -t
Segmentation fault       <---- segfault!
[edit load-balancing wan]
vyos@vyos# delete rule 0 
[edit load-balancing wan]
vyos@vyos# commit
[edit load-balancing wan]
vyos@vyos# /opt/vyatta/sbin/wan_lb -f /var/run/load-balance/wlb.conf  -t
[edit load-balancing wan]    <---- no output, no segfault
vyos@vyos# run show wan-load-balance 
Interface:  eth0v11
  Status:  active
  Last Status Change:  Sat Aug  3 01:22:24 2019
[...snip...]
vyos@vyos# run show version
Version:          VyOS 1.2.0-rolling+201906012240
Built by:         autobuild@vyos.net
Built on:         Sat 01 Jun 2019 22:40 UTC
Build UUID:       41289fb3-fdc7-4041-a248-7e03d99687c0
Build Commit ID:  e91ac330b78025

Architecture:     x86_64
Boot via:         installed image
System type:      KVM guest

Hardware vendor:  QEMU
Hardware model:   Standard PC (i440FX + PIIX, 1996)
Hardware S/N:     Unknown
Hardware UUID:    Unknown

Copyright:        VyOS maintainers and contributors

(also reproduced on 1.2.0-rolling+201907312142 )

Thanks!

Details

Difficulty level
Unknown (require assessment)
Version
1.2.0-rolling+201907312142
Why the issue appeared?
Will be filled on close

Event Timeline

sirsquidness created this object in space S1 VyOS Public.