]> git.ipfire.org Git - people/stevee/network.git/commit
config hook: prevent two hooks with the same settings
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Thu, 27 Jul 2017 12:07:01 +0000 (14:07 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 27 Jul 2017 14:21:23 +0000 (16:21 +0200)
commit6727e4bee839fa2415a6257a8aecfdd9dbbd025d
treee126066a1d925cfa9b2acdc6bde98d07325baaa2
parentc8aafc4ee446c55425ad2f98e5194759d11ca3f5
config hook: prevent two hooks with the same settings

A ipv4-static config with the same IPv4 address twice is senseless.
A new function zone_config_check_same_setting is introduced.
The function provides an easy way to check if a config
of the given hook has the same value for a given key.
We can now check inside hook_new if an ipv4-static or ipv6-static config
with the same value exist and break with an error.

Fixes: #11418
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.zone
src/hooks/configs/ipv4-static
src/hooks/configs/ipv6-static