Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
23.7 Legacy Series
»
Can only add host to alias via api if I use letter A-F or IP
« previous
next »
Print
Pages: [
1
]
Author
Topic: Can only add host to alias via api if I use letter A-F or IP (Read 589 times)
that_kid
Newbie
Posts: 3
Karma: 0
Can only add host to alias via api if I use letter A-F or IP
«
on:
October 05, 2023, 07:48:47 pm »
I'm not sure if I'm going crazy or not so I wanted to post here in hopes someone else can try this and see if it works. I have an alias and I would like to add a FQDN to the alias via the "alias_util/add" api but whenever I get an error "status": "not_an_address". I can add IP's without issues and any FQDN that is not past letter F, so aaa.aaa works, aaa.aaf works but aaa.aag does not. Looking at the code on GH and it looks like the regex only includes letters A-F
if (preg_match("/[^0-9a-f\:\.\/_]/", $address)) {
return array("status" => "not_an_address");
I just wanted to make sure I was on the correct track before submitting a Github issue.
Logged
Maurice
Hero Member
Posts: 1213
Karma: 158
Re: Can only add host to alias via api if I use letter A-F or IP
«
Reply #1 on:
October 06, 2023, 03:12:05 pm »
The regex is supposed to only allow IP addresses. a-f and ':' are required for IPv6.
Whether that's intentional I don't know.
Cheers
Maurice
Logged
OPNsense virtual machine images
OPNsense aarch64 firmware repository
Commercial support & engineering available. PM for details (en / de).
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
23.7 Legacy Series
»
Can only add host to alias via api if I use letter A-F or IP