From: David Ahern Date: Wed, 29 Aug 2018 23:53:27 +0000 (-0700) Subject: net/ipv4: Add extack message that dev is required for ONLINK X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=066b1030088986e61326938d5b7694e72ff693f8;p=android-x86%2Fkernel.git net/ipv4: Add extack message that dev is required for ONLINK Make IPv4 consistent with IPv6 and return an extack message that the ONLINK flag requires a nexthop device. Signed-off-by: David Ahern Signed-off-by: David S. Miller --- diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index f3c89ccf14c5..bee8db979195 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -797,8 +797,10 @@ static int fib_check_nh(struct fib_config *cfg, struct fib_nh *nh, return -EINVAL; } dev = __dev_get_by_index(net, nh->nh_oif); - if (!dev) + if (!dev) { + NL_SET_ERR_MSG(extack, "Nexthop device required for onlink"); return -ENODEV; + } if (!(dev->flags & IFF_UP)) { NL_SET_ERR_MSG(extack, "Nexthop device is not up");