net/haproxy: Backend Server unable to use IPV6 Address. Syntax Checking fails.
@fraenki is already working on this.
Since Feb 21, 2022.
- Dominant language
- PHP
- Stars
- 1.2k
- Forks
- 863
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 10
Description
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
- I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
- I have searched the existing issues, open and closed, and I'm convinced that mine is new.
- The title contains the plugin to which this issue belongs
Describe the bug
Setting a backend server's ip address to a valid IPV6 address results in a message like
'server $SERVER' : invalid character '$CHAR' in port number '$HEXTET' in '$IPV6_ADDRESS'
Adding brackets is impossible, otherwise the "Edit Server" dialog returns
Please specify a valid servername or IP address.
To Reproduce
Steps to reproduce the behavior:
- Go to 'Services -> HAProxy -> Settings'
- Click on 'Real Servers'
- Click on 'Add'
- Enter IPv6 address in 'Static Server -> IP or FQDN'
Expected behavior
Expected IPV6 address to be accepted and syntax test to pass.
Additional context
HAProxy is being used to load balance multiple servers not located on the OPNSense box.
I see some validation on line 262 here, but it doesn't look like that's where the actual validation and parsing is taking place.
After sleeping on it, it seems the code (wherever it is) reads the string from right to left, and treats the first colon as the delineation between the server address and port number.
Environment
OPNsense 21.7.7-amd64
Intel(R) Xeon(R) CPU E31225 @ 3.10GHz (4 cores)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.