• Taehee Yoo's avatar
    hsr: check protocol version in hsr_newlink() · 4faab8c4
    Taehee Yoo authored
    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: ee1c2797 ("net/hsr: Added support for HSR v1")
    Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    4faab8c4
hsr_netlink.c 11.9 KB