From: Andreas Roeseler <andreas.a.roeseler@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, yoshfuji@linux-ipv6.org, dsahern@kernel.org,
kuba@kernel.org, Andreas Roeseler <andreas.a.roeseler@gmail.com>
Subject: [PATCH net-next V5 5/6] ipv6: add ipv6_dev_find to stubs
Date: Wed, 24 Mar 2021 11:18:14 -0700 [thread overview]
Message-ID: <2d1a2ac63ae19879557526a1ca5dc37a04d1a076.1616608328.git.andreas.a.roeseler@gmail.com> (raw)
In-Reply-To: <cover.1616608328.git.andreas.a.roeseler@gmail.com>
Add ipv6_dev_find to ipv6_stub to allow lookup of net_devices by IPV6
address in net/ipv4/icmp.c.
Signed-off-by: Andreas Roeseler <andreas.a.roeseler@gmail.com>
---
include/net/ipv6_stubs.h | 2 ++
net/ipv6/addrconf_core.c | 7 +++++++
net/ipv6/af_inet6.c | 1 +
3 files changed, 10 insertions(+)
diff --git a/include/net/ipv6_stubs.h b/include/net/ipv6_stubs.h
index 8fce558b5fea..afbce90c4480 100644
--- a/include/net/ipv6_stubs.h
+++ b/include/net/ipv6_stubs.h
@@ -66,6 +66,8 @@ struct ipv6_stub {
int (*ipv6_fragment)(struct net *net, struct sock *sk, struct sk_buff *skb,
int (*output)(struct net *, struct sock *, struct sk_buff *));
+ struct net_device *(*ipv6_dev_find)(struct net *net, const struct in6_addr *addr,
+ struct net_device *dev);
};
extern const struct ipv6_stub *ipv6_stub __read_mostly;
diff --git a/net/ipv6/addrconf_core.c b/net/ipv6/addrconf_core.c
index c70c192bc91b..8f0b6024eba8 100644
--- a/net/ipv6/addrconf_core.c
+++ b/net/ipv6/addrconf_core.c
@@ -198,6 +198,12 @@ static int eafnosupport_ipv6_fragment(struct net *net, struct sock *sk, struct s
return -EAFNOSUPPORT;
}
+static struct net_device *eafnosupport_ipv6_dev_find(struct net *net, const struct in6_addr *addr,
+ struct net_device *dev)
+{
+ return ERR_PTR(-EAFNOSUPPORT);
+}
+
const struct ipv6_stub *ipv6_stub __read_mostly = &(struct ipv6_stub) {
.ipv6_dst_lookup_flow = eafnosupport_ipv6_dst_lookup_flow,
.ipv6_route_input = eafnosupport_ipv6_route_input,
@@ -209,6 +215,7 @@ const struct ipv6_stub *ipv6_stub __read_mostly = &(struct ipv6_stub) {
.fib6_nh_init = eafnosupport_fib6_nh_init,
.ip6_del_rt = eafnosupport_ip6_del_rt,
.ipv6_fragment = eafnosupport_ipv6_fragment,
+ .ipv6_dev_find = eafnosupport_ipv6_dev_find,
};
EXPORT_SYMBOL_GPL(ipv6_stub);
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 802f5111805a..f0b860aecc2f 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -1032,6 +1032,7 @@ static const struct ipv6_stub ipv6_stub_impl = {
#endif
.nd_tbl = &nd_tbl,
.ipv6_fragment = ip6_fragment,
+ .ipv6_dev_find = ipv6_dev_find,
};
static const struct ipv6_bpf_stub ipv6_bpf_stub_impl = {
--
2.17.1
next prev parent reply other threads:[~2021-03-24 18:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-24 18:17 [PATCH net-next V5 0/6] add support for RFC 8335 PROBE Andreas Roeseler
2021-03-24 18:17 ` [PATCH net-next V5 1/6] icmp: " Andreas Roeseler
2021-03-24 18:17 ` [PATCH net-next V5 2/6] ICMPV6: " Andreas Roeseler
2021-03-24 18:18 ` [PATCH net-next V5 3/6] net: add sysctl for enabling RFC 8335 PROBE messages Andreas Roeseler
2021-03-24 18:18 ` [PATCH net-next V5 4/6] net: add support for sending " Andreas Roeseler
2021-03-24 18:18 ` Andreas Roeseler [this message]
2021-03-24 18:18 ` [PATCH net-next V5 6/6] icmp: add response to " Andreas Roeseler
2021-03-24 19:47 ` Eric Dumazet
2021-03-24 20:24 ` Andreas Roeseler
2021-03-28 17:00 ` Willem de Bruijn
2021-03-29 18:33 ` Andreas Roeseler
2021-03-29 18:42 ` Willem de Bruijn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2d1a2ac63ae19879557526a1ca5dc37a04d1a076.1616608328.git.andreas.a.roeseler@gmail.com \
--to=andreas.a.roeseler@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).