mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
Services: Dnsmasq DNS & DHCP - extend model with a dns_port property which reflects the current listening port (for dns)
This commit is contained in:
parent
17b5859872
commit
5ea401df84
@ -37,11 +37,21 @@ use OPNsense\Base\Messages\Message;
|
||||
*/
|
||||
class Dnsmasq extends BaseModel
|
||||
{
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function init()
|
||||
{
|
||||
$this->dns_port = !empty((string)$this->port) ? (string)$this->port : '53'; /* port defaults */
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function performValidation($validateFullModel = false)
|
||||
{
|
||||
$this->dns_port = !empty((string)$this->port) ? (string)$this->port : '53'; /* port defaults */
|
||||
$messages = parent::performValidation($validateFullModel);
|
||||
foreach ($this->hosts->iterateItems() as $host) {
|
||||
if (!$validateFullModel && !$host->isFieldChanged()) {
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
<MinimumValue>0</MinimumValue>
|
||||
<MaximumValue>65535</MaximumValue>
|
||||
</port>
|
||||
<dns_port type="IntegerField" volatile="true"/>
|
||||
<dns_forward_max type="IntegerField">
|
||||
<MinimumValue>0</MinimumValue>
|
||||
</dns_forward_max>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user