• Thomas Graf's avatar
    [RTNL]: Validate hardware and broadcast address attribute for RTM_NEWLINK · 1840bb13
    Thomas Graf authored
    RTM_NEWLINK allows for already existing links to be modified. For this
    purpose do_setlink() is called which expects address attributes with a
    payload length of at least dev->addr_len. This patch adds the necessary
    validation for the RTM_NEWLINK case.
    
    The address length for links to be created is not checked for now as the
    actual attribute length is used when copying the address to the netdevice
    structure. It might make sense to report an error if less than addr_len
    bytes are provided but enforcing this might break drivers trying to be
    smart with not transmitting all zero addresses.
    Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1840bb13
rtnetlink.c 32.6 KB