Skip to content

Return comma separated list of LB IPs not just first #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

FinalDoom
Copy link

@FinalDoom FinalDoom commented Dec 2, 2024

  • Set unbound IP as comma separated list of LB IPs not just first
  • Keep first IP behavior for dnsmasq
  • Fix bug if no hosts are set in dnsmasq or unbound

Addresses #27

Demoed changes on https://onlinephp.io/c/ae9bb, and building locally. As mentioned, open to making this a setting, but I think all pfSense versions except those with the bug linked in #27 should accept a comma-separated list.

Slightly messy with implode/explode, but I didn't want to change the struct being used too much.

@@ -69,10 +69,14 @@ public function doAction()

if ($dnsmasqEnabled) {
$dnsmasqConfig = PfSenseConfigBlock::getRootConfigBlock($this->getController()->getRegistryItem('pfSenseClient'), 'dnsmasq');
if (!isset($dnsmasqConfig->data) || !is_array($dnsmasqConfig->data)) {
$dnsmasqConfig->data = [];
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a bug here if the hosts config is empty, it returns an empty string; so fixed that here and on unbound

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant