net: ipv6: introduce ip6_dst_mtu_maybe_forward
Replace ip6_dst_mtu_forward with ip6_dst_mtu_maybe_forward and reuse this code in ip6_mtu. Actually these two functions were almost duplicates, this change will simplify the maintaince of mtu calculation code. Signed-off-by: Vadim Fedorenko <vfedorenko@novek.ru> Reviewed-by: David Ahern <dsahern@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
7c804e91df
commit
427faee167
@@ -316,12 +316,13 @@ static inline bool rt6_duplicate_nexthop(struct fib6_info *a, struct fib6_info *
|
||||
!lwtunnel_cmp_encap(nha->fib_nh_lws, nhb->fib_nh_lws);
|
||||
}
|
||||
|
||||
static inline unsigned int ip6_dst_mtu_forward(const struct dst_entry *dst)
|
||||
static inline unsigned int ip6_dst_mtu_maybe_forward(const struct dst_entry *dst,
|
||||
bool forwarding)
|
||||
{
|
||||
struct inet6_dev *idev;
|
||||
unsigned int mtu;
|
||||
|
||||
if (dst_metric_locked(dst, RTAX_MTU)) {
|
||||
if (!forwarding || dst_metric_locked(dst, RTAX_MTU)) {
|
||||
mtu = dst_metric_raw(dst, RTAX_MTU);
|
||||
if (mtu)
|
||||
goto out;
|
||||
|
||||
Reference in New Issue
Block a user