All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
To: netfilter-devel@vger.kernel.org
Cc: pablo@netfilter.org, nbd@nbd.name
Subject: [RFC 3/9] ipv6: make ip6_dst_mtu_forward inline
Date: Sat, 17 Feb 2018 12:12:00 +0100	[thread overview]
Message-ID: <20180217111206.37312-3-nbd@nbd.name> (raw)
In-Reply-To: <20180217111206.37312-1-nbd@nbd.name>

Removes a direct dependency on ipv6.ko

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 include/net/ip6_route.h | 22 ++++++++++++++++++++++
 include/net/ipv6.h      |  2 --
 net/ipv6/ip6_output.c   | 22 ----------------------
 3 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 27d23a65f3cd..dae0ddfeb4db 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -266,4 +266,26 @@ static inline bool rt6_duplicate_nexthop(struct rt6_info *a, struct rt6_info *b)
 	       ipv6_addr_equal(&a->rt6i_gateway, &b->rt6i_gateway) &&
 	       !lwtunnel_cmp_encap(a->dst.lwtstate, b->dst.lwtstate);
 }
+
+static inline unsigned int ip6_dst_mtu_forward(const struct dst_entry *dst)
+{
+	unsigned int mtu;
+	struct inet6_dev *idev;
+
+	if (dst_metric_locked(dst, RTAX_MTU)) {
+		mtu = dst_metric_raw(dst, RTAX_MTU);
+		if (mtu)
+			return mtu;
+	}
+
+	mtu = IPV6_MIN_MTU;
+	rcu_read_lock();
+	idev = __in6_dev_get(dst->dev);
+	if (idev)
+		mtu = idev->cnf.mtu6;
+	rcu_read_unlock();
+
+	return mtu;
+}
+
 #endif
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 8606c9113d3f..51d559b19d85 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -970,8 +970,6 @@ static inline struct sk_buff *ip6_finish_skb(struct sock *sk)
 			      &inet6_sk(sk)->cork);
 }
 
-unsigned int ip6_dst_mtu_forward(const struct dst_entry *dst);
-
 int ip6_dst_lookup(struct net *net, struct sock *sk, struct dst_entry **dst,
 		   struct flowi6 *fl6);
 struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6,
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 997c7f19ad62..c7f3545f75f4 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -378,28 +378,6 @@ static inline int ip6_forward_finish(struct net *net, struct sock *sk,
 	return dst_output(net, sk, skb);
 }
 
-unsigned int ip6_dst_mtu_forward(const struct dst_entry *dst)
-{
-	unsigned int mtu;
-	struct inet6_dev *idev;
-
-	if (dst_metric_locked(dst, RTAX_MTU)) {
-		mtu = dst_metric_raw(dst, RTAX_MTU);
-		if (mtu)
-			return mtu;
-	}
-
-	mtu = IPV6_MIN_MTU;
-	rcu_read_lock();
-	idev = __in6_dev_get(dst->dev);
-	if (idev)
-		mtu = idev->cnf.mtu6;
-	rcu_read_unlock();
-
-	return mtu;
-}
-EXPORT_SYMBOL_GPL(ip6_dst_mtu_forward);
-
 static bool ip6_pkt_too_big(const struct sk_buff *skb, unsigned int mtu)
 {
 	if (skb->len <= mtu)
-- 
2.14.2


  parent reply	other threads:[~2018-02-17 11:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-17 11:11 [RFC 1/9] netfilter: nf_flow_table: use IP_CT_DIR_* values for FLOW_OFFLOAD_DIR_* Felix Fietkau
2018-02-17 11:11 ` [RFC 2/9] netfilter: nf_flow_table: clean up flow_offload_alloc Felix Fietkau
2018-02-17 11:12 ` Felix Fietkau [this message]
2018-02-17 11:12 ` [RFC 4/9] netfilter: nf_flow_table: cache mtu in struct flow_offload_tuple Felix Fietkau
2018-02-17 11:12 ` [RFC 5/9] netfilter: nf_flow_table: rename nf_flow_table.c to nf_flow_table_core.c Felix Fietkau
2018-02-17 11:12 ` [RFC 6/9] netfilter: nf_flow_table: move ipv4 offload hook code to nf_flow_table Felix Fietkau
2018-02-17 11:12 ` [RFC 7/9] netfilter: nf_flow_table: move ip header check out of nf_flow_exceeds_mtu Felix Fietkau
2018-02-17 11:12 ` [RFC 8/9] netfilter: nf_flow_table: move ipv6 offload hook code to nf_flow_table Felix Fietkau
2018-02-17 11:12 ` [RFC 9/9] netfilter: nf_flow_table: relax mixed ipv4/ipv6 flowtable dependencies Felix Fietkau

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=20180217111206.37312-3-nbd@nbd.name \
    --to=nbd@nbd.name \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.