]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/core/rtnetlink.c
[RTNL]: Improve error codes for unsupported operations
[mirror_ubuntu-bionic-kernel.git] / net / core / rtnetlink.c
index fa5f938b37ee09088306be541759e5f59527a4ac..5266df3370510ebd40af22b9e9e8e7ed4515391a 100644 (file)
@@ -862,7 +862,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
 
        type = nlh->nlmsg_type;
        if (type > RTM_MAX)
-               return -EINVAL;
+               return -EOPNOTSUPP;
 
        type -= RTM_BASE;
 
@@ -885,7 +885,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
 
                dumpit = rtnl_get_dumpit(family, type);
                if (dumpit == NULL)
-                       return -EINVAL;
+                       return -EOPNOTSUPP;
 
                return netlink_dump_start(rtnl, skb, nlh, dumpit, NULL);
        }
@@ -913,7 +913,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
 
        doit = rtnl_get_doit(family, type);
        if (doit == NULL)
-               return -EINVAL;
+               return -EOPNOTSUPP;
 
        return doit(skb, nlh, (void *)&rta_buf[0]);
 }