diff options
-rw-r--r-- | net/ipv4/route.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index baa9b289d7ab..844a9ef60dbd 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2232,8 +2232,27 @@ static int rt_fill_info(struct net *net, __be32 dst, __be32 src, | |||
2232 | error = rt->dst.error; | 2232 | error = rt->dst.error; |
2233 | 2233 | ||
2234 | if (rt_is_input_route(rt)) { | 2234 | if (rt_is_input_route(rt)) { |
2235 | if (nla_put_u32(skb, RTA_IIF, rt->rt_iif)) | 2235 | #ifdef CONFIG_IP_MROUTE |
2236 | goto nla_put_failure; | 2236 | if (ipv4_is_multicast(dst) && !ipv4_is_local_multicast(dst) && |
2237 | IPV4_DEVCONF_ALL(net, MC_FORWARDING)) { | ||
2238 | int err = ipmr_get_route(net, skb, | ||
2239 | fl4->saddr, fl4->daddr, | ||
2240 | r, nowait); | ||
2241 | if (err <= 0) { | ||
2242 | if (!nowait) { | ||
2243 | if (err == 0) | ||
2244 | return 0; | ||
2245 | goto nla_put_failure; | ||
2246 | } else { | ||
2247 | if (err == -EMSGSIZE) | ||
2248 | goto nla_put_failure; | ||
2249 | error = err; | ||
2250 | } | ||
2251 | } | ||
2252 | } else | ||
2253 | #endif | ||
2254 | if (nla_put_u32(skb, RTA_IIF, rt->rt_iif)) | ||
2255 | goto nla_put_failure; | ||
2237 | } | 2256 | } |
2238 | 2257 | ||
2239 | if (rtnl_put_cacheinfo(skb, &rt->dst, 0, expires, error) < 0) | 2258 | if (rtnl_put_cacheinfo(skb, &rt->dst, 0, expires, error) < 0) |