]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
neighbor: Initialize protocol when new pneigh_entry are created
authorDavid Ahern <dsahern@gmail.com>
Wed, 19 Dec 2018 23:53:22 +0000 (15:53 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Dec 2018 01:29:45 +0000 (17:29 -0800)
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>
net/core/neighbour.c

index 43687c9abe1dfae19bbe05d4f21f8a05a4960104..d9fa101b0e41578138f8bf19b52e0f51c2f23f27 100644 (file)
@@ -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;