opnsense / plugins

OPNsense plugin collection
https://opnsense.org/
BSD 2-Clause "Simplified" License
810 stars 593 forks source link

os-tftp: Listen Address does not allow IPv6 #4043

Open smrqdt opened 2 weeks ago

smrqdt commented 2 weeks ago

Important notices Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug It seems there is no way to enter an IPv6 Listen Address on ui/tftp/general/index. The validation does not allow to enter an IPv6 address with square brackets, while entering the Address without leads to tftpd not starting with the following log message:

Error in.tftpd Numeric IPv6 addresses need to be enclosed in []

Also, the help text (“Set the IP addresses to listen to.”) indicates multiple addresses could be entered, but I didn’t find a way to insert multiple which was accepted by the validation (neither comma nor space separated).

Validation error message:

{
  "result": "failed",
  "validations": {
    "general.listen": "Please specify a valid IP address or hostname."
  }
}

To Reproduce Steps to reproduce the behavior:

  1. Go to TFTP General Settings
  2. Enter an IPv6 address with brackets (e.g. [::])
  3. Observe Input Validation Error
  4. Enter an IPv6 address without brackets (e.g. ::) and save
  5. Observe TFTP not starting in the system log viewer

Expected behavior It should be possible to start tftpd on IPv6. If tftp doesn’t listen on both IPv4 and IPv6 with [::] as Listen Address, it should be possible to specify an IPv4 and an IPv6 address (or generally multiple addresses).

Screenshots image image

Environment

OPNsense 24.1.8-amd64 FreeBSD 13.2-RELEASE-p11 OpenSSL 3.0.13 os-tftp 1.0 tftp-hpa 5.2_2