]> git.baikalelectronics.ru Git - kernel.git/commit
tun: Persistent devices can get stuck in xoff state
authorMax Krasnyansky <maxk@qualcomm.com>
Thu, 10 Jul 2008 23:59:11 +0000 (16:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Jul 2008 23:59:11 +0000 (16:59 -0700)
commit17f3902ec3fd36da3de606198bef44becc2d47ca
tree703ee0018e29c07215e2bb3f3bc0b9040d2ce6fe
parentcad0d2d92f14dd80681de69e58ead8c97f04622d
tun: Persistent devices can get stuck in xoff state

The scenario goes like this. App stops reading from tun/tap.
TX queue gets full and driver does netif_stop_queue().
App closes fd and TX queue gets flushed as part of the cleanup.
Next time the app opens tun/tap and starts reading from it but
the xoff state is not cleared. We're stuck.
Normally xoff state is cleared when netdev is brought up. But
in the case of persistent devices this happens only during
initial setup.

The fix is trivial. If device is already up when an app opens
it we clear xoff state and that gets things moving again.

Signed-off-by: Max Krasnyansky <maxk@qualcomm.com>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c