]> git.baikalelectronics.ru Git - kernel.git/commit
net: check queue_index from sock is valid for device
authorTom Herbert <therbert@google.com>
Mon, 1 Nov 2010 19:55:52 +0000 (12:55 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Nov 2010 19:55:52 +0000 (12:55 -0700)
commitdd66a47ea6b3e269196020d3a1917490cdff681c
tree535d945c8507f8ac85575aed481bad9892a5e243
parentb398c6c454a7502db1c6f71b3e10beab8fa991a9
net: check queue_index from sock is valid for device

In dev_pick_tx recompute the queue index if the value stored in the
socket is greater than or equal to the number of real queues for the
device.  The saved index in the sock structure is not guaranteed to
be appropriate for the egress device (this could happen on a route
change or in presence of tunnelling).  The result of the queue index
being bad would be to return a bogus queue (crash could prersumably
follow).

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c