aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/neighbour.c
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2018-12-19 15:53:22 -0800
committerDavid S. Miller <davem@davemloft.net>2018-12-19 17:29:45 -0800
commit754d5da63145852736f34cfc762164f5d8d6537b (patch)
treee27c05bac0313a02d494f1811b5f01cb91602dc2 /net/core/neighbour.c
parentselftests: net: refactor reuseport_addr_any test (diff)
downloadlinux-dev-754d5da63145852736f34cfc762164f5d8d6537b.tar.xz
linux-dev-754d5da63145852736f34cfc762164f5d8d6537b.zip
neighbor: Initialize protocol when new pneigh_entry are created
pneigh_lookup uses kmalloc versus kzalloc when new entries are allocated. Given that the newly added protocol field needs to be initialized. Fixes: df9b0e30d44c ("neighbor: Add protocol attribute") Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/neighbour.c')
-rw-r--r--net/core/neighbour.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 43687c9abe1d..d9fa101b0e41 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -725,6 +725,7 @@ struct pneigh_entry * pneigh_lookup(struct neigh_table *tbl,
if (!n)
goto out;
+ n->protocol = 0;
write_pnet(&n->net, net);
memcpy(n->key, pkey, key_len);
n->dev = dev;