mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
VPN: WireGuard: Peer generator - add MTU when set on the instance, closes https://github.com/opnsense/core/issues/7422
This commit is contained in:
parent
db89247c20
commit
37696d6cab
@ -187,6 +187,7 @@ class ClientController extends ApiMutableModelControllerBase
|
||||
$peers = array_filter(explode(',', (string)$node->peers));
|
||||
$result['endpoint'] = (string)$node->endpoint;
|
||||
$result['peer_dns'] = (string)$node->peer_dns;
|
||||
$result['mtu'] = (string)$node->mtu;
|
||||
$result['pubkey'] = (string)$node->pubkey;
|
||||
foreach (array_filter(explode(',', (string)$node->tunneladdress)) as $addr) {
|
||||
$proto = str_contains($addr, ':') ? 'inet6' : 'inet';
|
||||
|
||||
@ -145,6 +145,7 @@
|
||||
endpoint
|
||||
.val(data.endpoint)
|
||||
.data('org-value', data.endpoint)
|
||||
.data('mtu', data.mtu)
|
||||
.data('pubkey', data.pubkey)
|
||||
.change();
|
||||
}
|
||||
@ -218,6 +219,9 @@
|
||||
if ($("#configbuilder\\.peer_dns").val()) {
|
||||
rows.push('DNS = ' + $("#configbuilder\\.peer_dns").val());
|
||||
}
|
||||
if ($("#configbuilder\\.endpoint").data('mtu')) {
|
||||
rows.push('MTU = ' + $("#configbuilder\\.endpoint").data('mtu'));
|
||||
}
|
||||
rows.push('');
|
||||
rows.push('[Peer]');
|
||||
rows.push('PublicKey = ' + $("#configbuilder\\.endpoint").data('pubkey'));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user