Révision e5b3335a
Ajouté par Renato Botelho il y a plus de 9 ans
usr/local/www/services_dhcp.php | ||
---|---|---|
211 | 211 |
return true; |
212 | 212 |
} |
213 | 213 |
|
214 |
if ($_POST) {
|
|
214 |
if (isset($_POST['submit'])) {
|
|
215 | 215 |
|
216 | 216 |
unset($input_errors); |
217 | 217 |
|
... | ... | |
503 | 503 |
} |
504 | 504 |
|
505 | 505 |
write_config(); |
506 |
} |
|
507 |
} |
|
506 | 508 |
|
507 |
$retval = 0; |
|
508 |
$retvaldhcp = 0; |
|
509 |
$retvaldns = 0; |
|
510 |
/* Stop DHCP so we can cleanup leases */ |
|
511 |
killbyname("dhcpd"); |
|
512 |
dhcp_clean_leases(); |
|
513 |
/* dnsmasq_configure calls dhcpd_configure */ |
|
514 |
/* no need to restart dhcpd twice */ |
|
515 |
if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) { |
|
516 |
$retvaldns = services_dnsmasq_configure(); |
|
517 |
if ($retvaldns == 0) { |
|
518 |
clear_subsystem_dirty('hosts'); |
|
519 |
clear_subsystem_dirty('staticmaps'); |
|
520 |
} |
|
521 |
} else { |
|
522 |
$retvaldhcp = services_dhcpd_configure(); |
|
523 |
if ($retvaldhcp == 0) |
|
524 |
clear_subsystem_dirty('staticmaps'); |
|
509 |
if (isset($_POST['submit']) || isset($_POST['apply'])) { |
|
510 |
$retval = 0; |
|
511 |
$retvaldhcp = 0; |
|
512 |
$retvaldns = 0; |
|
513 |
/* Stop DHCP so we can cleanup leases */ |
|
514 |
killbyname("dhcpd"); |
|
515 |
dhcp_clean_leases(); |
|
516 |
/* dnsmasq_configure calls dhcpd_configure */ |
|
517 |
/* no need to restart dhcpd twice */ |
|
518 |
if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) { |
|
519 |
$retvaldns = services_dnsmasq_configure(); |
|
520 |
if ($retvaldns == 0) { |
|
521 |
clear_subsystem_dirty('hosts'); |
|
522 |
clear_subsystem_dirty('staticmaps'); |
|
525 | 523 |
} |
526 |
if ($dhcpd_enable_changed) |
|
527 |
$retvalfc = filter_configure(); |
|
528 |
|
|
529 |
if($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1) |
|
530 |
$retval = 1; |
|
531 |
$savemsg = get_std_save_message($retval); |
|
524 |
} else { |
|
525 |
$retvaldhcp = services_dhcpd_configure(); |
|
526 |
if ($retvaldhcp == 0) |
|
527 |
clear_subsystem_dirty('staticmaps'); |
|
532 | 528 |
} |
529 |
if ($dhcpd_enable_changed) |
|
530 |
$retvalfc = filter_configure(); |
|
531 |
|
|
532 |
if($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1) |
|
533 |
$retval = 1; |
|
534 |
$savemsg = get_std_save_message($retval); |
|
533 | 535 |
} |
534 | 536 |
|
535 | 537 |
if ($act == "delpool") { |
... | ... | |
1159 | 1161 |
<input type="hidden" name="pool" value="<?php echo $pool; ?>"/> |
1160 | 1162 |
<?php endif; ?> |
1161 | 1163 |
<input name="if" type="hidden" value="<?=htmlspecialchars($if);?>"/> |
1162 |
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="enable_change(true)"/>
|
|
1164 |
<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="enable_change(true)"/>
|
|
1163 | 1165 |
</td> |
1164 | 1166 |
</tr> |
1165 | 1167 |
<tr> |
Formats disponibles : Unified diff
Do not call write_config() when click on Apply Changes because it was already done and it causes dhcpd to restart one more time on secondary nodes. It fixes #3797