netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] neighbor: Initialize protocol when new pneigh_entry are created
@ 2018-12-19 23:53 David Ahern
  2018-12-20  1:30 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: David Ahern @ 2018-12-19 23:53 UTC (permalink / raw)
  To: netdev; +Cc: davem, David Ahern

From: David Ahern <dsahern@gmail.com>

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>
---
 net/core/neighbour.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 1166a4b07445..8baa9ab01db6 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;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] neighbor: Initialize protocol when new pneigh_entry are created
  2018-12-19 23:53 [PATCH net-next] neighbor: Initialize protocol when new pneigh_entry are created David Ahern
@ 2018-12-20  1:30 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-12-20  1:30 UTC (permalink / raw)
  To: dsahern; +Cc: netdev, dsahern

From: David Ahern <dsahern@kernel.org>
Date: Wed, 19 Dec 2018 15:53:22 -0800

> From: David Ahern <dsahern@gmail.com>
> 
> 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>

Applied, thanks David.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-20  1:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-19 23:53 [PATCH net-next] neighbor: Initialize protocol when new pneigh_entry are created David Ahern
2018-12-20  1:30 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).