From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonatan Schlag To: network@lists.ipfire.org Subject: [PATCH 5/7] ipv6-dhcp: prevent multiple configs for the same zone Date: Tue, 04 Jul 2017 17:46:09 +0200 Message-ID: <1499183171-24236-5-git-send-email-jonatan.schlag@ipfire.org> In-Reply-To: <1499183171-24236-1-git-send-email-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8409764800512292471==" List-Id: --===============8409764800512292471== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit It is senseless to configure the ipv6-dhcp hook multiple times for a zone. Signed-off-by: Jonatan Schlag --- src/hooks/configs/ipv6-dhcp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hooks/configs/ipv6-dhcp b/src/hooks/configs/ipv6-dhcp index 03dbbf0..74ec765 100644 --- a/src/hooks/configs/ipv6-dhcp +++ b/src/hooks/configs/ipv6-dhcp @@ -27,6 +27,11 @@ hook_new() { local zone="${1}" shift + if zone_config_hook_is_configured ${zone} "ipv6-dhcp"; then + log ERROR "You can configure the ipv6-dhcp hook only once for a zone" + return ${EXIT_ERROR} + fi + zone_config_settings_write "${zone}" "${HOOK}" exit ${EXIT_OK} -- 2.6.3 --===============8409764800512292471==--