vxlan: fix hlist corruption
It's not a good idea to add the same hlist_node to two different hash lists.
This leads to various hard to debug memory corruptions.
Fixes: b1be00a6c3
("vxlan: support both IPv4 and IPv6 sockets in a single vxlan device")
Signed-off-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
c1c1d86bde
commit
69e766612c
@@ -221,9 +221,17 @@ struct vxlan_config {
|
||||
bool no_share;
|
||||
};
|
||||
|
||||
struct vxlan_dev_node {
|
||||
struct hlist_node hlist;
|
||||
struct vxlan_dev *vxlan;
|
||||
};
|
||||
|
||||
/* Pseudo network device */
|
||||
struct vxlan_dev {
|
||||
struct hlist_node hlist; /* vni hash table */
|
||||
struct vxlan_dev_node hlist4; /* vni hash table for IPv4 socket */
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
struct vxlan_dev_node hlist6; /* vni hash table for IPv6 socket */
|
||||
#endif
|
||||
struct list_head next; /* vxlan's per namespace list */
|
||||
struct vxlan_sock __rcu *vn4_sock; /* listening socket for IPv4 */
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
|
Reference in New Issue
Block a user