Skip to contentSkip to conversation

neighbor: Initialize protocol when new pneigh_entry are created

PATCH Applied David Ahern 2 participants 2 messages Dec 19, 2018 – Dec 20, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 neighbor: Initialize protocol when new pneigh_entry are created

From: David Ahern <[email protected]>

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")
---
 net/core/neighbour.c | 1 +
 1 file changed, 1 insertion(+)
net/core/neighbour.c +1 -0
index 1166a4b07445..8baa9ab01db6 100644
@@ -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;
Signature · 1 line
2.11.0
maintainer Applied
#1 lore raw

From: David Ahern <[email protected]>
Date: Wed, 19 Dec 2018 15:53:22 -0800

Quoted 7 lines

From: David Ahern <[email protected]>

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")

Applied, thanks David.