netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/ipv4: Add extack message that dev is required for ONLINK
@ 2018-08-29 23:53 dsahern
  2018-09-01  6:04 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: dsahern @ 2018-08-29 23:53 UTC (permalink / raw)
  To: netdev; +Cc: David Ahern

From: David Ahern <dsahern@gmail.com>

Make IPv4 consistent with IPv6 and return an extack message that the
ONLINK flag requires a nexthop device.

Signed-off-by: David Ahern <dsahern@gmail.com>
---
 net/ipv4/fib_semantics.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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");
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net/ipv4: Add extack message that dev is required for ONLINK
  2018-08-29 23:53 [PATCH net-next] net/ipv4: Add extack message that dev is required for ONLINK dsahern
@ 2018-09-01  6:04 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-09-01  6:04 UTC (permalink / raw)
  To: dsahern; +Cc: netdev, dsahern

From: dsahern@kernel.org
Date: Wed, 29 Aug 2018 16:53:27 -0700

> From: David Ahern <dsahern@gmail.com>
> 
> Make IPv4 consistent with IPv6 and return an extack message that the
> ONLINK flag requires a nexthop device.
> 
> Signed-off-by: David Ahern <dsahern@gmail.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-01 10:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-29 23:53 [PATCH net-next] net/ipv4: Add extack message that dev is required for ONLINK dsahern
2018-09-01  6:04 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).