|
@@ -2213,7 +2213,8 @@ errout:
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
-static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|
|
+static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh,
|
|
|
+ struct netlink_ext_ack *extack)
|
|
|
{
|
|
|
struct net *net = sock_net(skb->sk);
|
|
|
struct ifinfomsg *ifm;
|
|
@@ -2222,7 +2223,8 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|
|
struct nlattr *tb[IFLA_MAX+1];
|
|
|
char ifname[IFNAMSIZ];
|
|
|
|
|
|
- err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, NULL);
|
|
|
+ err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy,
|
|
|
+ extack);
|
|
|
if (err < 0)
|
|
|
goto errout;
|
|
|
|
|
@@ -2306,7 +2308,8 @@ int rtnl_delete_link(struct net_device *dev)
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(rtnl_delete_link);
|
|
|
|
|
|
-static int rtnl_dellink(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|
|
+static int rtnl_dellink(struct sk_buff *skb, struct nlmsghdr *nlh,
|
|
|
+ struct netlink_ext_ack *extack)
|
|
|
{
|
|
|
struct net *net = sock_net(skb->sk);
|
|
|
struct net_device *dev;
|
|
@@ -2315,7 +2318,7 @@ static int rtnl_dellink(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|
|
struct nlattr *tb[IFLA_MAX+1];
|
|
|
int err;
|
|
|
|
|
|
- err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, NULL);
|
|
|
+ err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, extack);
|
|
|
if (err < 0)
|
|
|
return err;
|
|
|
|
|
@@ -2426,7 +2429,8 @@ static int rtnl_group_changelink(const struct sk_buff *skb,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|
|
+static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
|
|
|
+ struct netlink_ext_ack *extack)
|
|
|
{
|
|
|
struct net *net = sock_net(skb->sk);
|
|
|
const struct rtnl_link_ops *ops;
|
|
@@ -2444,7 +2448,7 @@ static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|
|
#ifdef CONFIG_MODULES
|
|
|
replay:
|
|
|
#endif
|
|
|
- err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, NULL);
|
|
|
+ err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, extack);
|
|
|
if (err < 0)
|
|
|
return err;
|
|
|
|
|
@@ -2678,7 +2682,8 @@ out_unregister:
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh)
|
|
|
+static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr *nlh,
|
|
|
+ struct netlink_ext_ack *extack)
|
|
|
{
|
|
|
struct net *net = sock_net(skb->sk);
|
|
|
struct ifinfomsg *ifm;
|
|
@@ -2689,7 +2694,7 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh)
|
|
|
int err;
|
|
|
u32 ext_filter_mask = 0;
|
|
|
|
|
|
- err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, NULL);
|
|
|
+ err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, extack);
|
|
|
if (err < 0)
|
|
|
return err;
|
|
|
|
|
@@ -2960,7 +2965,8 @@ static int fdb_vid_parse(struct nlattr *vlan_attr, u16 *p_vid)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|
|
+static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,
|
|
|
+ struct netlink_ext_ack *extack)
|
|
|
{
|
|
|
struct net *net = sock_net(skb->sk);
|
|
|
struct ndmsg *ndm;
|
|
@@ -2970,7 +2976,7 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|
|
u16 vid;
|
|
|
int err;
|
|
|
|
|
|
- err = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, NULL, NULL);
|
|
|
+ err = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, NULL, extack);
|
|
|
if (err < 0)
|
|
|
return err;
|
|
|
|
|
@@ -3060,7 +3066,8 @@ int ndo_dflt_fdb_del(struct ndmsg *ndm,
|
|
|
}
|
|
|
EXPORT_SYMBOL(ndo_dflt_fdb_del);
|
|
|
|
|
|
-static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|
|
+static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
|
|
|
+ struct netlink_ext_ack *extack)
|
|
|
{
|
|
|
struct net *net = sock_net(skb->sk);
|
|
|
struct ndmsg *ndm;
|
|
@@ -3073,7 +3080,7 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|
|
if (!netlink_capable(skb, CAP_NET_ADMIN))
|
|
|
return -EPERM;
|
|
|
|
|
|
- err = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, NULL, NULL);
|
|
|
+ err = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, NULL, extack);
|
|
|
if (err < 0)
|
|
|
return err;
|
|
|
|
|
@@ -3503,7 +3510,8 @@ errout:
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
-static int rtnl_bridge_setlink(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|
|
+static int rtnl_bridge_setlink(struct sk_buff *skb, struct nlmsghdr *nlh,
|
|
|
+ struct netlink_ext_ack *extack)
|
|
|
{
|
|
|
struct net *net = sock_net(skb->sk);
|
|
|
struct ifinfomsg *ifm;
|
|
@@ -3577,7 +3585,8 @@ out:
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
-static int rtnl_bridge_dellink(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|
|
+static int rtnl_bridge_dellink(struct sk_buff *skb, struct nlmsghdr *nlh,
|
|
|
+ struct netlink_ext_ack *extack)
|
|
|
{
|
|
|
struct net *net = sock_net(skb->sk);
|
|
|
struct ifinfomsg *ifm;
|
|
@@ -3945,7 +3954,8 @@ static size_t if_nlmsg_stats_size(const struct net_device *dev,
|
|
|
return size;
|
|
|
}
|
|
|
|
|
|
-static int rtnl_stats_get(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|
|
+static int rtnl_stats_get(struct sk_buff *skb, struct nlmsghdr *nlh,
|
|
|
+ struct netlink_ext_ack *extack)
|
|
|
{
|
|
|
struct net *net = sock_net(skb->sk);
|
|
|
struct net_device *dev = NULL;
|
|
@@ -4107,7 +4117,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
|
|
|
if (doit == NULL)
|
|
|
return -EOPNOTSUPP;
|
|
|
|
|
|
- return doit(skb, nlh);
|
|
|
+ return doit(skb, nlh, extack);
|
|
|
}
|
|
|
|
|
|
static void rtnetlink_rcv(struct sk_buff *skb)
|