linux/net/hsr
Taehee Yoo 22ea267a9c hsr: check protocol version in hsr_newlink()
[ Upstream commit 4faab8c446 ]

In the current hsr code, only 0 and 1 protocol versions are valid.
But current hsr code doesn't check the version, which is received by
userspace.

Test commands:
    ip link add dummy0 type dummy
    ip link add dummy1 type dummy
    ip link add hsr0 type hsr slave1 dummy0 slave2 dummy1 version 4

In the test commands, version 4 is invalid.
So, the command should be failed.

After this patch, following error will occur.
"Error: hsr: Only versions 0..1 are supported."

Fixes: ee1c279772 ("net/hsr: Added support for HSR v1")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-21 09:04:44 +02:00
..
Kconfig
Makefile
hsr_debugfs.c
hsr_device.c
hsr_device.h
hsr_forward.c
hsr_forward.h
hsr_framereg.c
hsr_framereg.h
hsr_main.c
hsr_main.h
hsr_netlink.c hsr: check protocol version in hsr_newlink() 2020-04-21 09:04:44 +02:00
hsr_netlink.h
hsr_slave.c
hsr_slave.h