udp6: set rx_dst_cookie on rx_dst updates
authorPaolo Abeni <pabeni@redhat.com>
Fri, 25 Aug 2017 12:31:01 +0000 (14:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Sep 2017 06:22:07 +0000 (08:22 +0200)
commit38ca2d395e1cd24f205db3176c4ce9198f22576e
treec921502a8678e231a1949fd751bd683a2024105b
parentb4426cf203667b2ef94ade4d7e43e8ae39e9697d
udp6: set rx_dst_cookie on rx_dst updates

[ Upstream commit 64f0f5d18a47c703c85576375cc010e83dac6a48 ]

Currently, in the udp6 code, the dst cookie is not initialized/updated
concurrently with the RX dst used by early demux.

As a result, the dst_check() in the early_demux path always fails,
the rx dst cache is always invalidated, and we can't really
leverage significant gain from the demux lookup.

Fix it adding udp6 specific variant of sk_rx_dst_set() and use it
to set the dst cookie when the dst entry is really changed.

The issue is there since the introduction of early demux for ipv6.

Fixes: 5425077d73e0 ("net: ipv6: Add early demux handler for UDP unicast")
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/net/udp.h
net/ipv4/udp.c
net/ipv6/udp.c