Project

General

Profile

Actions

Bug #10724

closed

Allowed Hostnames adds/deletes only one A entry

Added by Viktor Gurov over 4 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
Normal
Category:
Captive Portal
Target version:
Start date:
07/03/2020
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.4.5-p1
Affected Architecture:

Description

If you add a hostname on services_captiveportal_hostname.php page,
it adds only single IP (A entry) from DNS answer,

For example:
If you want to add yandex.ru to allowed hostnames, it adds only first IP from the DNS answer:

# dig a yandex.ru
...
;; ANSWER SECTION:
yandex.ru.              66    IN    A    77.88.55.50
yandex.ru.              66    IN    A    5.255.255.50
yandex.ru.              66    IN    A    77.88.55.88
yandex.ru.              66    IN    A    5.255.255.5 

this is caused by using gethostbyname() in captiveportal_allowedip_configure_entry()

after reboot, it populates ipfw tables with all IP addresses, because filterdns is used

The same error if you try to delete a host entry on services_captiveportal_hostname.php page -
gethostbyname() is used to search for IP, causing only the first IP address to be removed from table

Actions

Also available in: Atom PDF