]> git.baikalelectronics.ru Git - kernel.git/commit
ipvlan: fix dev_id creation corner case.
authorMahesh Bandewar <maheshb@google.com>
Fri, 13 Jan 2017 23:48:30 +0000 (15:48 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Jan 2017 19:04:43 +0000 (14:04 -0500)
commit742c96a55d27c9bf592520a8f8a9bb62a5146d9c
treeb906dbf74a54e18b08830fc37ccb45d082c25f9b
parent9fd2268683f4015547f4f8ab25c4994780c7c566
ipvlan: fix dev_id creation corner case.

In the last patch 464ec276941 ("ipvlan: improvise dev_id generation
logic in IPvlan") I missed some part of Dave's suggestion and because
of that the dev_id creation could fail in a corner case scenario. This
would happen when more or less 64k devices have been already created and
several have been deleted. If the devices that are still sticking around
are the last n bits from the bitmap. So in this scenario even if lower
bits are available, the dev_id search is so narrow that it always fails.

Fixes: 464ec276941 ("ipvlan: improvise dev_id generation logic in IPvlan")
CC: David Miller <davem@davemloft.org>
CC: Eric Dumazet <edumazet@google.com>
Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipvlan/ipvlan_main.c