From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Schantl To: development@lists.ipfire.org Subject: Re: [[PATCHv2]] Fix hook for static address configuration. Date: Sat, 11 Aug 2018 21:52:13 +0200 Message-ID: <5881bbbb3b0e3ac3506312a4fc36ca977bb7f0f7.camel@ipfire.org> In-Reply-To: <20180811191908.14010-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3385231851788703878==" List-Id: --===============3385231851788703878== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Ignore this patch, I've forgot to cc the network mailing list. Thanks in advance, -Stefan > Add the required hook_new function and "id" information which have > been > introduced in earlier commits to make this hook work again. > > Signed-off-by: Stefan Schantl > --- > src/hooks/configs/static | 21 ++++++++++++++++++++- > 1 file changed, 20 insertions(+), 1 deletion(-) > > diff --git a/src/hooks/configs/static b/src/hooks/configs/static > index 91bba8a..23ae2d8 100644 > --- a/src/hooks/configs/static > +++ b/src/hooks/configs/static > @@ -52,6 +52,8 @@ hook_check_config_settings() { > > hook_parse_cmdline() { > local protocol > + local id="${1}" > + shift > > while [ $# -gt 0 ]; do > case "${1}" in > @@ -153,12 +155,29 @@ hook_parse_cmdline() { > fi > > # Check any conflicts > - if zone_config_check_same_setting "${zone}" "static" > "ADDRESS" "${ADDRESS}"; then > + if zone_config_check_same_setting "${zone}" "static" "${id}" > "ADDRESS" "${ADDRESS}"; then > error "A static configuration with the same address > is already configured" > return ${EXIT_CONF_ERROR} > fi > } > > +hook_new() { > + local zone="${1}" > + shift > + > + local id=$(zone_config_get_new_id ${zone}) > + log DEBUG "ID for the config is: ${id}" > + > + if ! hook_parse_cmdline "${id}" "$@"; then > + # Return an error if the parsing of the cmd line > fails > + return ${EXIT_ERROR} > + fi > + > + zone_config_settings_write "${zone}" "${HOOK}" "${id}" > + > + exit ${EXIT_OK} > +} > + > hook_up() { > local zone="${1}" > local config="${2}" --===============3385231851788703878== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64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