OSDN Git Service

ipv4: igmp: guard against silly MTU values
authorEric Dumazet <edumazet@google.com>
Mon, 11 Dec 2017 15:17:39 +0000 (07:17 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Jan 2018 19:35:10 +0000 (20:35 +0100)
commitc2f78bf8ca3aa18e51f1de41093db5adae2c5f34
tree031e6d39f3ceb1b4962b2b58af9f1c7851bc8743
parentb929ccccbc8c22736d1fd722da181e275465f5a6
ipv4: igmp: guard against silly MTU values

[ Upstream commit b5476022bbada3764609368f03329ca287528dc8 ]

IPv4 stack reacts to changes to small MTU, by disabling itself under
RTNL.

But there is a window where threads not using RTNL can see a wrong
device mtu. This can lead to surprises, in igmp code where it is
assumed the mtu is suitable.

Fix this by reading device mtu once and checking IPv4 minimal MTU.

This patch adds missing IPV4_MIN_MTU define, to not abuse
ETH_MIN_MTU anymore.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/net/ip.h
net/ipv4/devinet.c
net/ipv4/igmp.c
net/ipv4/ip_tunnel.c