diff options
author | David Ahern <dsahern@gmail.com> | 2019-04-05 16:30:24 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-08 15:22:40 -0700 |
commit | 1aefd3de7bc667115bb77cb0bc21e874c7e190fc (patch) | |
tree | cb139989f63ebc52363410cb0042136172c0e209 /net/ipv6/addrconf_core.c | |
parent | 3b8b11f96616c2e763ebcc093b778b309fc07a92 (diff) | |
download | linux-1aefd3de7bc667115bb77cb0bc21e874c7e190fc.tar.gz linux-1aefd3de7bc667115bb77cb0bc21e874c7e190fc.tar.bz2 linux-1aefd3de7bc667115bb77cb0bc21e874c7e190fc.zip |
ipv6: Add fib6_nh_init and release to stubs
Add fib6_nh_init and fib6_nh_release to ipv6_stubs. If fib6_nh_init fails,
callers should not invoke fib6_nh_release, so there is no reason to have
a dummy stub for the IPv6 is not enabled case.
Signed-off-by: David Ahern <dsahern@gmail.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/addrconf_core.c')
-rw-r--r-- | net/ipv6/addrconf_core.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/ipv6/addrconf_core.c b/net/ipv6/addrconf_core.c index 945b66e3008f..e37e4c5871f7 100644 --- a/net/ipv6/addrconf_core.c +++ b/net/ipv6/addrconf_core.c @@ -173,6 +173,14 @@ eafnosupport_ip6_mtu_from_fib6(struct fib6_info *f6i, struct in6_addr *daddr, return 0; } +static int eafnosupport_fib6_nh_init(struct net *net, struct fib6_nh *fib6_nh, + struct fib6_config *cfg, gfp_t gfp_flags, + struct netlink_ext_ack *extack) +{ + NL_SET_ERR_MSG(extack, "IPv6 support not enabled in kernel"); + return -EAFNOSUPPORT; +} + const struct ipv6_stub *ipv6_stub __read_mostly = &(struct ipv6_stub) { .ipv6_dst_lookup = eafnosupport_ipv6_dst_lookup, .ipv6_route_input = eafnosupport_ipv6_route_input, @@ -181,6 +189,7 @@ const struct ipv6_stub *ipv6_stub __read_mostly = &(struct ipv6_stub) { .fib6_lookup = eafnosupport_fib6_lookup, .fib6_multipath_select = eafnosupport_fib6_multipath_select, .ip6_mtu_from_fib6 = eafnosupport_ip6_mtu_from_fib6, + .fib6_nh_init = eafnosupport_fib6_nh_init, }; EXPORT_SYMBOL_GPL(ipv6_stub); |