Skip to content
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

Closes #77 Allow IPv4/6 address as tunnel network on overrides #85

Closed
wants to merge 1 commit into from

Conversation

TTPBruce
Copy link

No description provided.

@TTPBruce TTPBruce mentioned this pull request Aug 11, 2023
@opoplawski
Copy link
Contributor

Thank you for the PR. Ideally I'd like to get closer to pfSense's validation:

function openvpn_validate_tunnel_network($value, $ipproto) {
        $value = trim($value);
        if (!empty($value)) {
                if (is_alias($value) && (alias_get_type($value) == 'network')) {
                        $net = alias_to_subnets_recursive($value);
                        if ((!is_subnetv4($net[0]) && ($ipproto == 'ipv4')) ||
                            (!is_subnetv6($net[0]) && ($ipproto == 'ipv6')) ||
                            (count($net) > 1)) {
                                return false;
                        }
                        return true;
                } else {
                        if ((!is_subnetv4($value) && ($ipproto == 'ipv4')) ||
                            (!is_subnetv6($value) && ($ipproto == 'ipv6'))) {
                                return false;
                        }
                }
        }
        return true;
}

But this may be a good first step. Let's see how difficult this is.

@opoplawski opoplawski added this to the 0.6.0 milestone Dec 23, 2023
@opoplawski
Copy link
Contributor

Closed in preference for #110

@opoplawski opoplawski closed this Jan 5, 2024
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.

2 participants