diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-04-20 18:34:20 +0300 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-04-20 18:34:20 +0300 |
commit | f7ea285b6266822bd63af2a3695f03e3357fd74f (patch) | |
tree | ad5d6f3bab25094c81a072fb56fcac2f50ed91ed /net/hsr/hsr_netlink.c | |
parent | 97e130f63757ede9abc4a9ee42b5fcad466a8e97 (diff) | |
parent | c7582ff7ed388b803d083166514a4c8acd4ef57d (diff) |
Merge branch 'ib-pdx86-properties'
Merge branch 'ib-pdx86-properties' of
git://git.infradead.org/linux-platform-drivers-x86.git
to avoid conflicts in PDx86.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'net/hsr/hsr_netlink.c')
-rw-r--r-- | net/hsr/hsr_netlink.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c index 5465a395da04..1decb25f6764 100644 --- a/net/hsr/hsr_netlink.c +++ b/net/hsr/hsr_netlink.c @@ -69,10 +69,16 @@ static int hsr_newlink(struct net *src_net, struct net_device *dev, else multicast_spec = nla_get_u8(data[IFLA_HSR_MULTICAST_SPEC]); - if (!data[IFLA_HSR_VERSION]) + if (!data[IFLA_HSR_VERSION]) { hsr_version = 0; - else + } else { hsr_version = nla_get_u8(data[IFLA_HSR_VERSION]); + if (hsr_version > 1) { + NL_SET_ERR_MSG_MOD(extack, + "Only versions 0..1 are supported"); + return -EINVAL; + } + } return hsr_dev_finalize(dev, link, multicast_spec, hsr_version, extack); } |