From a871e2f5c4a0187818dc7e1984b2cd86a2c61a4c Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Wed, 24 Feb 2021 22:36:57 +0900 Subject: net: add comments to code where MTU is handed incorrectly But I'm not going to fix them - it's unlikely I actually hit these code paths. --- net/ipv4/ip_output.c | 1 + net/ipv4/raw.c | 1 + net/ipv6/raw.c | 1 + net/ipv6/route.c | 2 ++ 4 files changed, 5 insertions(+) diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 2ed0b01f72f0..7870b27e62aa 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -1264,6 +1264,7 @@ static int ip_setup_cork(struct sock *sk, struct inet_cork *cork, cork->addr = ipc->addr; } + /* XXX: MTU */ cork->fragsize = ip_sk_use_pmtu(sk) ? dst_mtu(&rt->dst) : READ_ONCE(rt->dst.dev->mtu); diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 50a73178d63a..331197f08497 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c @@ -355,6 +355,7 @@ static int raw_send_hdrinc(struct sock *sk, struct flowi4 *fl4, struct rtable *rt = *rtp; int hlen, tlen; + /* XXX: MTU */ if (length > rt->dst.dev->mtu) { ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport, rt->dst.dev->mtu); diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 1f56d9aae589..4987eb7e1368 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c @@ -628,6 +628,7 @@ static int rawv6_send_hdrinc(struct sock *sk, struct msghdr *msg, int length, int hlen = LL_RESERVED_SPACE(rt->dst.dev); int tlen = rt->dst.dev->needed_tailroom; + /* XXX: MTU */ if (length > rt->dst.dev->mtu) { ipv6_local_error(sk, EMSGSIZE, fl6, rt->dst.dev->mtu); return -EMSGSIZE; diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 506f258bfa76..42b33b6cea0a 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -2004,6 +2004,7 @@ static bool rt6_mtu_change_route_allowed(struct inet6_dev *idev, if (dst_mtu(&rt->dst) >= mtu) return true; + /* XXX: MTU */ if (dst_mtu(&rt->dst) == idev->cnf.mtu6) return true; @@ -4798,6 +4799,7 @@ static int fib6_nh_mtu_change(struct fib6_nh *nh, void *_arg) struct inet6_dev *idev = __in6_dev_get(arg->dev); u32 mtu = f6i->fib6_pmtu; + /* XXX: MTU */ if (mtu >= arg->mtu || (mtu < arg->mtu && mtu == idev->cnf.mtu6)) fib6_metric_set(f6i, RTAX_MTU, arg->mtu); -- cgit v1.2.3