]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - net/core/neighbour.c
neighbor: Call __ipv4_neigh_lookup_noref in neigh_xmit
authorDavid Ahern <dsahern@gmail.com>
Thu, 2 May 2019 01:18:42 +0000 (18:18 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit4a235c941f2707f6981c471fe2c47869a30e6013
tree9fc91d7f95326cec5e2aa155ebfa84b4c4538efc
parent137c097e48f05e63fe566a777ccf01e0694a6505
neighbor: Call __ipv4_neigh_lookup_noref in neigh_xmit

BugLink: https://bugs.launchpad.net/bugs/1838700
[ Upstream commit 4b2a2bfeb3f056461a90bd621e8bd7d03fa47f60 ]

Commit cd9ff4de0107 changed the key for IFF_POINTOPOINT devices to
INADDR_ANY but neigh_xmit which is used for MPLS encapsulations was not
updated to use the altered key. The result is that every packet Tx does
a lookup on the gateway address which does not find an entry, a new one
is created only to find the existing one in the table right before the
insert since arp_constructor was updated to reset the primary key. This
is seen in the allocs and destroys counters:
    ip -s -4 ntable show | head -10 | grep alloc

which increase for each packet showing the unnecessary overhread.

Fix by having neigh_xmit use __ipv4_neigh_lookup_noref for NEIGH_ARP_TABLE.

Fixes: cd9ff4de0107 ("ipv4: Make neigh lookup keys for loopback/point-to-point devices be INADDR_ANY")
Reported-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
Tested-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/core/neighbour.c