mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
Commitdc2a27e524("neighbour: Update pneigh_entry in pneigh_create().") moved the update of flags, protocol and permanent from neigh_add() into pneigh_create(). However, arp_req_set_public() also calls pneigh_create(), with all three set to zero. As of now, SIOCSARP on an address that already has a proxy entry clears the flags of the entry and makes it non-permanent. The entry is then removed when the carrier goes down, and the host no longer answers ARP requests for the address. A similar issue happened before with the protocol. It was fixed by commitcbada10488("neighbour: restore protocol != 0 check in pneigh update"). Perhaps flags and permanent need a fix as well. The issue can be reproduced with: ip link add d0 type veth peer name d1 ip link set d0 up ip link set d1 up ip neigh add proxy 10.9.9.9 dev d0 arp -i d0 -Ds 10.9.9.9 d0 pub ip link set d1 down sleep 1 ip neigh show proxy Before commitdc2a27e524("neighbour: Update pneigh_entry in pneigh_create()."), the result is: 10.9.9.9 dev d0 proxy After that commit, the result is empty. This patch will add an update argument to pneigh_create(). Only neigh_add() sets it, so SIOCSARP leaves an existing entry alone again. Fixes:dc2a27e524("neighbour: Update pneigh_entry in pneigh_create().") Signed-off-by: Hengyu Liang <[email protected]> Reviewed-by: Kuniyuki Iwashima <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>