From f00ff0de40030ed86e7d78c8c1f77b042b51d38c Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Tue, 2 May 2017 20:32:42 +0100 Subject: network: reject bridge port priorities above kernel's max value. (#5877) Bridge port priority in the kernel can only be between 0 and 63. Therefore reject values above maximum. Fixes: #5729 --- src/libsystemd-network/network-internal.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/libsystemd-network/network-internal.h') diff --git a/src/libsystemd-network/network-internal.h b/src/libsystemd-network/network-internal.h index 5bcd577167..4666f174e9 100644 --- a/src/libsystemd-network/network-internal.h +++ b/src/libsystemd-network/network-internal.h @@ -26,6 +26,9 @@ #include "condition.h" #include "udev.h" +#define LINK_BRIDGE_PORT_PRIORITY_INVALID 128 +#define LINK_BRIDGE_PORT_PRIORITY_MAX 63 + bool net_match_config(const struct ether_addr *match_mac, char * const *match_path, char * const *match_driver, @@ -62,6 +65,10 @@ int config_parse_iaid(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); +int config_parse_bridge_port_priority(const char *unit, const char *filename, unsigned line, + const char *section, unsigned section_line, const char *lvalue, + int ltype, const char *rvalue, void *data, void *userdata); + int net_get_unique_predictable_data(struct udev_device *device, uint64_t *result); const char *net_get_name(struct udev_device *device); -- cgit v1.2.3-54-g00ecf