tun: Fix unicast filter overflow
commit9ac2dfbf36bfd3913267be078f756e0806b3694f
authorAlex Williamson <alex.williamson@hp.com>
Mon, 9 Feb 2009 01:49:17 +0000 (8 17:49 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 17 Feb 2009 17:29:00 +0000 (17 09:29 -0800)
treee588060533d5fd4f61bbf6893fe7f8de3c1f22b8
parent0ae6310e3fcaf33209b676333ae3aa7451ebd394
tun: Fix unicast filter overflow

[ Upstream commit cfbf84fcbcda98bb91ada683a8dc8e6901a83ebd ]

Tap devices can make use of a small MAC filter set via the
TUNSETTXFILTER ioctl.  The filter has a set of exact matches
plus a hash for imperfect filtering of additional multicast
addresses.  The current code is unbalanced, adding unicast
addresses to the multicast hash, but only checking the hash
against multicast addresses.  This results in the filter
dropping unicast addresses that overflow the exact filter.
The fix is simply to disable the filter by leaving count set
to zero if we find non-multicast addresses after the exact
match table is filled.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/tun.c