Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 066b1030 authored by David Ahern's avatar David Ahern Committed by David S. Miller
Browse files

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: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7788174e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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");