Re: [tipc-discussion] [PATCH net 1/2] tipc: add tipc_bearer_min_mtu to calculate min mtu
From: Xin Long <lucien.xin@gmail.com>
Date: 2023-05-01 20:18:24
On Mon, May 1, 2023 at 11:35 AM Xin Long [off-list ref] wrote:
On Mon, May 1, 2023 at 1:21 AM Tung Quang Nguyen [off-list ref] wrote:quoted
quoted
@@ -760,6 +760,7 @@ static int tipc_udp_enable(struct net *net, struct tipc_bearer *b, else udp_conf.local_ip6 = local.ipv6; ub->ifindex = dev->ifindex; + b->encap_hlen = sizeof(struct ipv6hdr) + sizeof(struct udphdr);tipc_mtu_bad() needs to be called here to check for the minimum required MTU like the way ipv4 UDP bearer does.Agree, especially after commit 5a6f6f579178 ("tipc: set ub->ifindex for local ipv6 address"), we have the dev there.
After taking a second look, I think we should delete the tipc_mtu_bad()
call for ipv4 UDP bearer, as b->mtu is no longer using dev->mtu since:
commit a4dfa72d0acd ("tipc: set default MTU for UDP media")
The issue described in commit 3de81b758853 ("tipc: check minimum bearer MTU")
no longer exists in UDP bearer.
Besides, dev->mtu can still be changed to a too small mtu after the UDP
bearer is created even with the tipc_mtu_bad() check in tipc_udp_enable().
Note that NETDEV_CHANGEMTU event processing in tipc_l2_device_event()
doesn't really work for UDP bearer.
I will leave this patch as it is in my v2 post, and create another patch
for net-next to delete the unnecessary tipc_mtu_bad() check in UDP bearer.
Agree?
Thanks.