1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Fri, 16 Feb 2018 10:54:24 +0100
3 Subject: [PATCH] ipv6: make ip6_dst_mtu_forward inline
5 Removes a direct dependency on ipv6.ko
7 Signed-off-by: Felix Fietkau <nbd@nbd.name>
10 --- a/include/net/ip6_route.h
11 +++ b/include/net/ip6_route.h
12 @@ -252,4 +252,26 @@ static inline bool rt6_duplicate_nexthop
13 ipv6_addr_equal(&a->rt6i_gateway, &b->rt6i_gateway) &&
14 !lwtunnel_cmp_encap(a->dst.lwtstate, b->dst.lwtstate);
17 +static inline unsigned int ip6_dst_mtu_forward(const struct dst_entry *dst)
20 + struct inet6_dev *idev;
22 + if (dst_metric_locked(dst, RTAX_MTU)) {
23 + mtu = dst_metric_raw(dst, RTAX_MTU);
30 + idev = __in6_dev_get(dst->dev);
32 + mtu = idev->cnf.mtu6;
39 --- a/include/net/ipv6.h
40 +++ b/include/net/ipv6.h
41 @@ -889,8 +889,6 @@ static inline struct sk_buff *ip6_finish
45 -unsigned int ip6_dst_mtu_forward(const struct dst_entry *dst);
47 int ip6_dst_lookup(struct net *net, struct sock *sk, struct dst_entry **dst,
49 struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6,
50 --- a/net/ipv6/ip6_output.c
51 +++ b/net/ipv6/ip6_output.c
52 @@ -381,28 +381,6 @@ static inline int ip6_forward_finish(str
53 return dst_output(net, sk, skb);
56 -unsigned int ip6_dst_mtu_forward(const struct dst_entry *dst)
59 - struct inet6_dev *idev;
61 - if (dst_metric_locked(dst, RTAX_MTU)) {
62 - mtu = dst_metric_raw(dst, RTAX_MTU);
69 - idev = __in6_dev_get(dst->dev);
71 - mtu = idev->cnf.mtu6;
76 -EXPORT_SYMBOL_GPL(ip6_dst_mtu_forward);
78 static bool ip6_pkt_too_big(const struct sk_buff *skb, unsigned int mtu)