OSDN Git Service

net: ipv4: fix multipath RTM_GETROUTE behavior when iif is given
authorFlorian Larysch <fl@n621.de>
Mon, 3 Apr 2017 14:46:09 +0000 (16:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 May 2017 15:36:35 +0000 (08:36 -0700)
commitdbaaa5890df768e273231303659d1238e7f9ae6c
treef00bdbad248ecd547b1fad84c0d05544cd9a7cb8
parent425cc775d18aa176bdbd2600c4509be14f5c938d
net: ipv4: fix multipath RTM_GETROUTE behavior when iif is given

[ Upstream commit a8801799c6975601fd58ae62f48964caec2eb83f ]

inet_rtm_getroute synthesizes a skeletal ICMP skb, which is passed to
ip_route_input when iif is given. If a multipath route is present for
the designated destination, ip_multipath_icmp_hash ends up being called,
which uses the source/destination addresses within the skb to calculate
a hash. However, those are not set in the synthetic skb, causing it to
return an arbitrary and incorrect result.

Instead, use UDP, which gets no such special treatment.

Signed-off-by: Florian Larysch <fl@n621.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/route.c