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

Commit 901731b8 authored by David Ahern's avatar David Ahern Committed by Daniel Borkmann
Browse files

net/ipv6: Add helper to return path MTU based on fib result



Determine path MTU from a FIB lookup result. Logic is based on
ip6_dst_mtu_forward plus lookup of nexthop exception.

Add ip6_dst_mtu_forward to ipv6_stubs to handle access by core
bpf code.

Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 50d889b1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -236,6 +236,8 @@ struct ipv6_stub {
						   struct flowi6 *fl6, int oif,
						   const struct sk_buff *skb,
						   int strict);
	u32 (*ip6_mtu_from_fib6)(struct fib6_info *f6i, struct in6_addr *daddr,
				 struct in6_addr *saddr);

	void (*udpv6_encap_enable)(void);
	void (*ndisc_send_na)(struct net_device *dev, const struct in6_addr *daddr,
+6 −0
Original line number Diff line number Diff line
@@ -412,6 +412,12 @@ static inline struct net_device *fib6_info_nh_dev(const struct fib6_info *f6i)
	return f6i->fib6_nh.nh_dev;
}

static inline
struct lwtunnel_state *fib6_info_nh_lwt(const struct fib6_info *f6i)
{
	return f6i->fib6_nh.nh_lwtstate;
}

void inet6_rt_notify(int event, struct fib6_info *rt, struct nl_info *info,
		     unsigned int flags);

+3 −0
Original line number Diff line number Diff line
@@ -300,6 +300,9 @@ static inline unsigned int ip6_dst_mtu_forward(const struct dst_entry *dst)
	return mtu;
}

u32 ip6_mtu_from_fib6(struct fib6_info *f6i, struct in6_addr *daddr,
		      struct in6_addr *saddr);

struct neighbour *ip6_neigh_lookup(const struct in6_addr *gw,
				   struct net_device *dev, struct sk_buff *skb,
				   const void *daddr);
+8 −0
Original line number Diff line number Diff line
@@ -161,12 +161,20 @@ eafnosupport_fib6_multipath_select(const struct net *net, struct fib6_info *f6i,
	return f6i;
}

static u32
eafnosupport_ip6_mtu_from_fib6(struct fib6_info *f6i, struct in6_addr *daddr,
			       struct in6_addr *saddr)
{
	return 0;
}

const struct ipv6_stub *ipv6_stub __read_mostly = &(struct ipv6_stub) {
	.ipv6_dst_lookup   = eafnosupport_ipv6_dst_lookup,
	.fib6_get_table    = eafnosupport_fib6_get_table,
	.fib6_table_lookup = eafnosupport_fib6_table_lookup,
	.fib6_lookup       = eafnosupport_fib6_lookup,
	.fib6_multipath_select = eafnosupport_fib6_multipath_select,
	.ip6_mtu_from_fib6 = eafnosupport_ip6_mtu_from_fib6,
};
EXPORT_SYMBOL_GPL(ipv6_stub);

+1 −0
Original line number Diff line number Diff line
@@ -894,6 +894,7 @@ static const struct ipv6_stub ipv6_stub_impl = {
	.fib6_table_lookup = fib6_table_lookup,
	.fib6_lookup       = fib6_lookup,
	.fib6_multipath_select = fib6_multipath_select,
	.ip6_mtu_from_fib6 = ip6_mtu_from_fib6,
	.udpv6_encap_enable = udpv6_encap_enable,
	.ndisc_send_na = ndisc_send_na,
	.nd_tbl	= &nd_tbl,
Loading