]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: bcm_sf2: Fix IPv6 rule half deletion
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 15 May 2018 23:01:25 +0000 (16:01 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 May 2018 18:11:22 +0000 (14:11 -0400)
commit61d23d1636d3d948ed1a4f57c03653f2486dbdf7
treebaef285c02d4616782e6c11976041e3f3889bcf0
parent61306ea98ae1560dbe6e62952bbb37d5d0f316a2
net: dsa: bcm_sf2: Fix IPv6 rule half deletion

It was possible to delete only one half of an IPv6, which would leave
the second half still programmed and possibly in use. Instead of
checking for the unused bitmap, we need to check the unique bitmap, and
refuse any deletion that does not match that criteria. We also need to
move that check from bcm_sf2_cfp_rule_del_one() into its caller:
bcm_sf2_cfp_rule_del() otherwise we would not be able to delete second
halves anymore that would not pass the first test.

Fixes: ffa4f02cb393 ("net: dsa: bcm_sf2: Add support for IPv6 CFP rules")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/bcm_sf2_cfp.c