From: Michael Tremer Date: Thu, 8 Sep 2016 16:42:41 +0000 (+0200) Subject: DHCP: Check if subnet range already exists before creating X-Git-Tag: 009~287 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=089e7410edd98d232381cdbcde58b89fff797eb0;p=network.git DHCP: Check if subnet range already exists before creating Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.dhcpd b/src/functions/functions.dhcpd index b112eed6..5e44cd6a 100644 --- a/src/functions/functions.dhcpd +++ b/src/functions/functions.dhcpd @@ -755,6 +755,12 @@ dhcpd_subnet_range_new() { return ${EXIT_ERROR} fi + # Check if range already exists + if dhcpd_subnet_range_exists ${proto} ${subnet} ${range}; then + error "DHCP subnet range ${range} already exists" + return ${EXIT_ERROR} + fi + # Write the configuration to file. local file=$(dhcpd_subnet_range_path ${proto} ${subnet} "${START}-${END}") assert isset file