Page MenuHomeVyOS Platform

"set load-balancing wan rule 0" causes segfault and prevents load balancing from starting
Closed, ResolvedPublic

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:         [email protected]
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
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

reproduced on 1.2-rolling-201909100338

~$ show vers
Version: VyOS 1.2-rolling-201909100338
Built by: [email protected]
Built on: Tue 10 Sep 2019 03:38 UTC
Build UUID: c5e300e2-5b03-4e1a-912a-afdb39fa08a9
Build Commit ID: 39ae5d423cb293

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

Hardware vendor: VMware, Inc.
Hardware model: VMware Virtual Platform
Hardware S/N: VMware-4*
Hardware UUID: 4*

Copyright: VyOS maintainers and contributors

zsdc assigned this task to Unknown Object (User).Oct 21 2019, 1:07 PM
Unknown Object (User) added a comment.EditedOct 24 2019, 8:53 AM

Pull Request sent to fix the code.

https://github.com/vyos/vyatta-wanloadbalance/pull/7

Unknown Object (User) added a comment.Oct 24 2019, 9:17 AM

Pull request sent to correct manual example.

https://github.com/vyos/vyos-documentation/pull/136

Unknown Object (User) closed this task as Resolved.Oct 26 2019, 12:17 PM
Unknown Object (User) set Is it a breaking change? to Unspecified (possibly destroys the router).

Thanks for the contribution!

c-po renamed this task from `set load-balancing wan rule 0` causes segfault and prevents load balancing from starting to "set load-balancing wan rule 0" causes segfault and prevents load balancing from starting.Oct 26 2019, 10:25 PM
c-po closed this task as Resolved.
c-po removed a project: vyatta-wanloadbalance.
c-po moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus board.
c-po moved this task from Needs Triage to Finished on the VyOS 1.2 Crux (VyOS 1.2.4) board.