]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
net: dsa: bcm_sf2: Fix IPv6 rules and chain ID
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 15 May 2018 23:01:24 +0000 (16:01 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:30:00 +0000 (12:30 +0200)
commit0c0af52f9a2e81448ce76484461cb8005f6e734c
treed7c0e863391ebcd28311a2856546df4dc091b50a
parent36d88f50f5fcdf35f61a0207d2f9dffd8169e93c
net: dsa: bcm_sf2: Fix IPv6 rules and chain ID

BugLink: http://bugs.launchpad.net/bugs/1783418
[ Upstream commit 6c05561c541843b2bec2189f680bed6d20afc25b ]

We had several issues that would make the programming of IPv6 rules both
inconsistent and error prone:

- the chain ID that we would be asking the hardware to put in the
  packet's Broadcom tag would be off by one, it would return one of the
  two indexes, but not the one user-space specified

- when an user specified a particular location to insert a CFP rule at,
  we would not be returning the same index, which would be confusing if
  nothing else

- finally, like IPv4, it would be possible to overflow the last entry by
  re-programming it

Fix this by swapping the usage of rule_index[0] and rule_index[1] where
relevant in order to return a consistent and correct user-space
experience.

Fixes: ba0696c22e7c ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/dsa/bcm_sf2_cfp.c