Bug #4844
closedError loading rules for numeric host name in alias
100%
Description
Create a host-type alias. Put just a number in "IP or FQDN" - e.g. I made alias name "Zqw" and a single host "23". The webGUI reports:
There were error(s) loading the rules: /tmp/rules.debug:44: syntax error - The line in question reads [44]: table { 23 }
and /tmp/rules.debug has:
table <Zqw> { 23 }
Zqw = "<Zqw>"
which pf does not cope with.
It is possible to have a host name that is a number, and end up with a domain name like 23.mycompany.com - unfortunately some Wally allowed such things in standards many years ago, so it can be rather difficult to tell the difference between a number and a host name.
I had attempted to fix this with https://github.com/pfsense/pfsense/commit/81a73bcba3b3a79bb3a7add2e14a46e6af748f50 but it broke port aliases and was rightly reverted. It needs some more accuracy on tests that detect what is a number that is_port() and what is a number that is a name in the context of a host alias.
Updated by Phillip Davis over 9 years ago
I found the dumb error in my previous attempt. This pull request works for me on a system with a mix of nested host/network/port aliases:
https://github.com/pfsense/pfsense/pull/1759
Updated by Renato Botelho over 9 years ago
- Status changed from New to Feedback
- Assignee set to Renato Botelho
- % Done changed from 0 to 100
Pull request has been merged
Updated by Phillip Davis over 9 years ago
Note: This seems to have broken url_port alias processing.
See new bug https://redmine.pfsense.org/issues/4888