Project

General

Profile

Bug #10724

Allowed Hostnames adds/deletes only one A entry

Added by Viktor Gurov 4 months ago. Updated 3 months ago.

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

100%

Estimated time:
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

Associated revisions

Revision 5fe8efc2 (diff)
Added by Viktor Gurov 4 months ago

Allowed Hostnames add/delete multiple A entries. Fixes #10724

History

#2 Updated by Jim Pingle 4 months ago

  • Status changed from New to Pull Request Review
  • Target version set to 2.5.0

#3 Updated by Renato Botelho 4 months ago

  • Status changed from Pull Request Review to Feedback
  • Assignee set to Renato Botelho
  • % Done changed from 0 to 100

PR has been merged. Thanks!

#4 Updated by Viktor Gurov 3 months ago

  • Status changed from Feedback to Resolved

works as expected on 2.5.0.a.20200709.1250

Also available in: Atom PDF