Skip to content

Commit cbada10

Browse files
qsnkuba-moo
authored andcommitted
neighbour: restore protocol != 0 check in pneigh update
Prior to commit dc2a27e ("neighbour: Update pneigh_entry in pneigh_create()."), a pneigh's protocol was updated only when the value of the NDA_PROTOCOL attribute was non-0. While moving the code, that check was removed. This is a small change of user-visible behavior, and inconsistent with the (non-proxy) neighbour behavior. Fixes: dc2a27e ("neighbour: Update pneigh_entry in pneigh_create().") Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Reviewed-by: David Ahern <dsahern@kernel.org> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/38c61de1bb032871a886aff9b9b52fe1cdd4cada.1772894876.git.sd@queasysnail.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent e8f0dc0 commit cbada10

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

net/core/neighbour.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,8 @@ int pneigh_create(struct neigh_table *tbl, struct net *net,
820820
update:
821821
WRITE_ONCE(n->flags, flags);
822822
n->permanent = permanent;
823-
WRITE_ONCE(n->protocol, protocol);
823+
if (protocol)
824+
WRITE_ONCE(n->protocol, protocol);
824825
out:
825826
mutex_unlock(&tbl->phash_lock);
826827
return err;

0 commit comments

Comments
 (0)