]> git.ipfire.org Git - people/ms/network.git/commitdiff
Do not allow to create ethernet devices with an invalid MAC address
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 Sep 2018 18:25:15 +0000 (20:25 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 Sep 2018 18:25:15 +0000 (20:25 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/hooks/ports/ethernet

index cdc3dec7d2c7e98279a48604c4d5cb7d4c6b8d08..0d9c5cd62165ef8d6d40dfcf96a49e576efd712e 100644 (file)
@@ -29,6 +29,9 @@ HOOK_SETTINGS="ADDRESS ADVERTISED_LINK_SPEEDS DEVICE OFFLOADING MTU"
 hook_check_settings() {
        assert ismac DEVICE
 
+       # Invalid MAC addresses are not allowed
+       assert not isoneof DEVICE 00:00:00:00:00:00 ff:ff:ff:ff:ff:ff
+
        if isset ADDRESS; then
                assert ismac ADDRESS
        fi