]> git.baikalelectronics.ru Git - kernel.git/commit
rtnetlink: Add more extack messages to rtnl_newlink
authorDavid Ahern <dsahern@gmail.com>
Tue, 6 Nov 2018 20:51:16 +0000 (12:51 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 6 Nov 2018 23:00:45 +0000 (15:00 -0800)
commite25b2e626f1bdd2654e49ff2b0c7eacc1e9eb965
treea1961d9305000dc38c7ec2fc315a818b710e4055
parent87854aed9dfd0227f34b605e6955cda236847ede
rtnetlink: Add more extack messages to rtnl_newlink

Add extack arg to the nla_parse_nested calls in rtnl_newlink, and
add messages for unknown device type and link network namespace id.
In particular, it improves the failure message when the wrong link
type is used. From
    $ ip li add bond1 type bonding
    RTNETLINK answers: Operation not supported
to
    $ ip li add bond1 type bonding
    Error: Unknown device type.

(The module name is bonding but the link type is bond.)

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c