Skip to contentSkip to conversation

net: Use helper macro IP_MAX_MTU in __ip_append_data()

PATCH Applied Miaohe Lin 2 participants 2 messages Aug 29, 2020 – Aug 31, 2020

Subsystems (3)
lore
Share & tools
lore

Miaohe Lin

author
#0 lore raw

PATCH 1/1 net: Use helper macro IP_MAX_MTU in __ip_append_data()

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

---
 net/ipv4/ip_output.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/ip_output.c +1 -1
index 329a0ab87542..f0f234727547 100644
@@ -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,
Signature · 1 line
2.19.1