Skip to content

Commit fd61c6b

Browse files
David Aherndavem330
authored andcommitted
net: ipv6: remove nowait arg to rt6_fill_node
All callers of rt6_fill_node pass 0 for nowait arg. Remove the arg and simplify rt6_fill_node accordingly. rt6_fill_node passes the nowait of 0 to ip6mr_get_route. Remove the nowait arg from it as well. Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1ce463d commit fd61c6b

File tree

3 files changed

+13
-25
lines changed

3 files changed

+13
-25
lines changed

include/linux/mroute6.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ struct mfc6_cache {
116116

117117
struct rtmsg;
118118
extern int ip6mr_get_route(struct net *net, struct sk_buff *skb,
119-
struct rtmsg *rtm, int nowait, u32 portid);
119+
struct rtmsg *rtm, u32 portid);
120120

121121
#ifdef CONFIG_IPV6_MROUTE
122122
extern struct sock *mroute6_socket(struct net *net, struct sk_buff *skb);

net/ipv6/ip6mr.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,7 +2288,7 @@ static int __ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb,
22882288
}
22892289

22902290
int ip6mr_get_route(struct net *net, struct sk_buff *skb, struct rtmsg *rtm,
2291-
int nowait, u32 portid)
2291+
u32 portid)
22922292
{
22932293
int err;
22942294
struct mr6_table *mrt;
@@ -2315,11 +2315,6 @@ int ip6mr_get_route(struct net *net, struct sk_buff *skb, struct rtmsg *rtm,
23152315
struct net_device *dev;
23162316
int vif;
23172317

2318-
if (nowait) {
2319-
read_unlock(&mrt_lock);
2320-
return -EAGAIN;
2321-
}
2322-
23232318
dev = skb->dev;
23242319
if (!dev || (vif = ip6mr_find_vif(mrt, dev)) < 0) {
23252320
read_unlock(&mrt_lock);
@@ -2357,7 +2352,7 @@ int ip6mr_get_route(struct net *net, struct sk_buff *skb, struct rtmsg *rtm,
23572352
return err;
23582353
}
23592354

2360-
if (!nowait && (rtm->rtm_flags&RTM_F_NOTIFY))
2355+
if (rtm->rtm_flags & RTM_F_NOTIFY)
23612356
cache->mfc_flags |= MFC_NOTIFY;
23622357

23632358
err = __ip6mr_fill_mroute(mrt, skb, cache, rtm);

net/ipv6/route.c

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3169,7 +3169,7 @@ static int rt6_fill_node(struct net *net,
31693169
struct sk_buff *skb, struct rt6_info *rt,
31703170
struct in6_addr *dst, struct in6_addr *src,
31713171
int iif, int type, u32 portid, u32 seq,
3172-
int prefix, int nowait, unsigned int flags)
3172+
int prefix, unsigned int flags)
31733173
{
31743174
u32 metrics[RTAX_MAX];
31753175
struct rtmsg *rtm;
@@ -3261,19 +3261,12 @@ static int rt6_fill_node(struct net *net,
32613261
if (iif) {
32623262
#ifdef CONFIG_IPV6_MROUTE
32633263
if (ipv6_addr_is_multicast(&rt->rt6i_dst.addr)) {
3264-
int err = ip6mr_get_route(net, skb, rtm, nowait,
3265-
portid);
3266-
3267-
if (err <= 0) {
3268-
if (!nowait) {
3269-
if (err == 0)
3270-
return 0;
3271-
goto nla_put_failure;
3272-
} else {
3273-
if (err == -EMSGSIZE)
3274-
goto nla_put_failure;
3275-
}
3276-
}
3264+
int err = ip6mr_get_route(net, skb, rtm, portid);
3265+
3266+
if (err == 0)
3267+
return 0;
3268+
if (err < 0)
3269+
goto nla_put_failure;
32773270
} else
32783271
#endif
32793272
if (nla_put_u32(skb, RTA_IIF, iif))
@@ -3342,7 +3335,7 @@ int rt6_dump_route(struct rt6_info *rt, void *p_arg)
33423335
return rt6_fill_node(arg->net,
33433336
arg->skb, rt, NULL, NULL, 0, RTM_NEWROUTE,
33443337
NETLINK_CB(arg->cb->skb).portid, arg->cb->nlh->nlmsg_seq,
3345-
prefix, 0, NLM_F_MULTI);
3338+
prefix, NLM_F_MULTI);
33463339
}
33473340

33483341
static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh)
@@ -3433,7 +3426,7 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh)
34333426

34343427
err = rt6_fill_node(net, skb, rt, &fl6.daddr, &fl6.saddr, iif,
34353428
RTM_NEWROUTE, NETLINK_CB(in_skb).portid,
3436-
nlh->nlmsg_seq, 0, 0, 0);
3429+
nlh->nlmsg_seq, 0, 0);
34373430
if (err < 0) {
34383431
kfree_skb(skb);
34393432
goto errout;
@@ -3460,7 +3453,7 @@ void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info,
34603453
goto errout;
34613454

34623455
err = rt6_fill_node(net, skb, rt, NULL, NULL, 0,
3463-
event, info->portid, seq, 0, 0, nlm_flags);
3456+
event, info->portid, seq, 0, nlm_flags);
34643457
if (err < 0) {
34653458
/* -EMSGSIZE implies BUG in rt6_nlmsg_size() */
34663459
WARN_ON(err == -EMSGSIZE);

0 commit comments

Comments
 (0)