@@ -8,7 +8,8 @@
#include <uapi/linux/rtnetlink.h>
extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo);
-extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid);
+extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid,
+ gfp_t flags);
extern void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid,
u32 group, struct nlmsghdr *nlh, gfp_t flags);
extern void rtnl_set_sk_err(struct net *net, u32 group, int error);
@@ -646,7 +646,7 @@ static int rtnl_net_getid(struct sk_buff *skb, struct nlmsghdr *nlh)
if (err < 0)
goto err_out;
- err = rtnl_unicast(msg, net, NETLINK_CB(skb).portid);
+ err = rtnl_unicast(msg, net, NETLINK_CB(skb).portid, GFP_KERNEL);
goto out;
err_out:
@@ -653,11 +653,11 @@ int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned int g
return err;
}
-int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid)
+int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid, gfp_t flags)
{
struct sock *rtnl = net->rtnl;
- return nlmsg_unicast(rtnl, skb, pid, gfp_any());
+ return nlmsg_unicast(rtnl, skb, pid, flags);
}
EXPORT_SYMBOL(rtnl_unicast);
@@ -2565,7 +2565,8 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh)
WARN_ON(err == -EMSGSIZE);
kfree_skb(nskb);
} else
- err = rtnl_unicast(nskb, net, NETLINK_CB(skb).portid);
+ err = rtnl_unicast(nskb, net, NETLINK_CB(skb).portid,
+ GFP_KERNEL);
return err;
}
@@ -3601,7 +3602,8 @@ static int rtnl_stats_get(struct sk_buff *skb, struct nlmsghdr *nlh)
WARN_ON(err == -EMSGSIZE);
kfree_skb(nskb);
} else {
- err = rtnl_unicast(nskb, net, NETLINK_CB(skb).portid);
+ err = rtnl_unicast(nskb, net, NETLINK_CB(skb).portid,
+ GFP_KERNEL);
}
return err;
@@ -1749,7 +1749,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh)
nlmsg_end(reply_skb, reply_nlh);
- ret = rtnl_unicast(reply_skb, net, portid);
+ ret = rtnl_unicast(reply_skb, net, portid, GFP_KERNEL);
out:
return ret;
}
@@ -1714,7 +1714,8 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh)
goto out_free;
}
- return rtnl_unicast(skb, &init_net, NETLINK_CB(in_skb).portid);
+ return rtnl_unicast(skb, &init_net, NETLINK_CB(in_skb).portid,
+ GFP_KERNEL);
out_free:
kfree_skb(skb);
@@ -1917,7 +1917,7 @@ static int inet_netconf_get_devconf(struct sk_buff *in_skb,
kfree_skb(skb);
goto errout;
}
- err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid);
+ err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid, GFP_ATOMIC);
errout:
return err;
}
@@ -654,7 +654,8 @@ static void ipmr_destroy_unres(struct mr_table *mrt, struct mfc_cache *c)
e->error = -ETIMEDOUT;
memset(&e->msg, 0, sizeof(e->msg));
- rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
+ rtnl_unicast(skb, net, NETLINK_CB(skb).portid,
+ gfp_any());
} else {
kfree_skb(skb);
}
@@ -933,7 +934,8 @@ static void ipmr_cache_resolve(struct net *net, struct mr_table *mrt,
memset(&e->msg, 0, sizeof(e->msg));
}
- rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
+ rtnl_unicast(skb, net, NETLINK_CB(skb).portid,
+ gfp_any());
} else {
ip_mr_forward(net, mrt, skb, c, 0);
}
@@ -2621,7 +2621,7 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh)
if (err < 0)
goto errout_free;
- err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid);
+ err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid, GFP_KERNEL);
errout:
return err;
@@ -628,7 +628,7 @@ static int inet6_netconf_get_devconf(struct sk_buff *in_skb,
kfree_skb(skb);
goto errout;
}
- err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid);
+ err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid, GFP_ATOMIC);
errout:
return err;
}
@@ -4824,7 +4824,7 @@ static int inet6_rtm_getaddr(struct sk_buff *in_skb, struct nlmsghdr *nlh)
kfree_skb(skb);
goto errout_ifa;
}
- err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid);
+ err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid, GFP_KERNEL);
errout_ifa:
in6_ifa_put(ifa);
errout:
@@ -580,7 +580,7 @@ static int ip6addrlbl_get(struct sk_buff *in_skb, struct nlmsghdr *nlh)
goto out;
}
- err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid);
+ err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid, GFP_KERNEL);
out:
return err;
}
@@ -850,7 +850,8 @@ static void ip6mr_destroy_unres(struct mr6_table *mrt, struct mfc6_cache *c)
nlh->nlmsg_len = nlmsg_msg_size(sizeof(struct nlmsgerr));
skb_trim(skb, nlh->nlmsg_len);
((struct nlmsgerr *)nlmsg_data(nlh))->error = -ETIMEDOUT;
- rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
+ rtnl_unicast(skb, net, NETLINK_CB(skb).portid,
+ gfp_any());
} else
kfree_skb(skb);
}
@@ -1114,7 +1115,8 @@ static void ip6mr_cache_resolve(struct net *net, struct mr6_table *mrt,
skb_trim(skb, nlh->nlmsg_len);
((struct nlmsgerr *)nlmsg_data(nlh))->error = -EMSGSIZE;
}
- rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
+ rtnl_unicast(skb, net, NETLINK_CB(skb).portid,
+ gfp_any());
} else
ip6_mr_forward(net, mrt, skb, c);
}
@@ -3367,7 +3367,7 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh)
goto errout;
}
- err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid);
+ err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid, GFP_KERNEL);
errout:
return err;
}
@@ -737,7 +737,7 @@ act_get_notify(struct net *net, u32 portid, struct nlmsghdr *n,
return -EINVAL;
}
- return rtnl_unicast(skb, net, portid);
+ return rtnl_unicast(skb, net, portid, GFP_KERNEL);
}
static struct tc_action *create_a(int i)
Signed-off-by: Masashi Honma <masashi.honma@gmail.com> --- include/linux/rtnetlink.h | 3 ++- net/core/net_namespace.c | 2 +- net/core/rtnetlink.c | 10 ++++++---- net/dcb/dcbnl.c | 2 +- net/decnet/dn_route.c | 3 ++- net/ipv4/devinet.c | 2 +- net/ipv4/ipmr.c | 6 ++++-- net/ipv4/route.c | 2 +- net/ipv6/addrconf.c | 4 ++-- net/ipv6/addrlabel.c | 2 +- net/ipv6/ip6mr.c | 6 ++++-- net/ipv6/route.c | 2 +- net/sched/act_api.c | 2 +- 13 files changed, 27 insertions(+), 19 deletions(-)