]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
tuntap: attach queue 0 before registering netdevice
authorJason Wang <jasowang@redhat.com>
Sun, 2 Dec 2012 17:19:45 +0000 (17:19 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Dec 2012 18:47:57 +0000 (13:47 -0500)
commiteb0fb363f920e4d8c70d30b712f9dd433271218c
tree947aa526a29af66a659f7e995b77167bd09d658f
parent092a5fc9636268bc2c0fef4d9b99845699cf19f9
tuntap: attach queue 0 before registering netdevice

We attach queue 0 after registering netdevice currently. This leads to call
netif_set_real_num_{tx|rx}_queues() after registering the netdevice. Since we
allow tun/tap has a maximum of 1024 queues, this may lead a huge number of
uevents to be injected to userspace since we create 2048 kobjects and then
remove 2046. Solve this problem by attaching queue 0 and set the real number of
queues before registering netdevice.

Reported-by: Jiri Slaby <jslaby@suse.cz>
Tested-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c