linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: Use helper macro IP_MAX_MTU in __ip_append_data()
@ 2020-08-29  9:09 Miaohe Lin
  2020-08-31 19:33 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Miaohe Lin @ 2020-08-29  9:09 UTC (permalink / raw)
  To: davem, kuznet, yoshfuji, kuba; +Cc: netdev, linux-kernel, linmiaohe

What 0xFFFF means here is actually the max mtu of a ip packet. Use help
macro IP_MAX_MTU here.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 net/ipv4/ip_output.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 329a0ab87542..f0f234727547 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -996,7 +996,7 @@ static int __ip_append_data(struct sock *sk,
 
 	fragheaderlen = sizeof(struct iphdr) + (opt ? opt->optlen : 0);
 	maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen;
-	maxnonfragsize = ip_sk_ignore_df(sk) ? 0xFFFF : mtu;
+	maxnonfragsize = ip_sk_ignore_df(sk) ? IP_MAX_MTU : mtu;
 
 	if (cork->length + length > maxnonfragsize - fragheaderlen) {
 		ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport,
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: Use helper macro IP_MAX_MTU in __ip_append_data()
  2020-08-29  9:09 [PATCH] net: Use helper macro IP_MAX_MTU in __ip_append_data() Miaohe Lin
@ 2020-08-31 19:33 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-08-31 19:33 UTC (permalink / raw)
  To: linmiaohe; +Cc: kuznet, yoshfuji, kuba, netdev, linux-kernel

From: Miaohe Lin <linmiaohe@huawei.com>
Date: Sat, 29 Aug 2020 05:09:18 -0400

> What 0xFFFF means here is actually the max mtu of a ip packet. Use help
> macro IP_MAX_MTU here.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-31 19:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-29  9:09 [PATCH] net: Use helper macro IP_MAX_MTU in __ip_append_data() Miaohe Lin
2020-08-31 19:33 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).