]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ixgbe: fdb: only allow NUD_PERM fdb entries
authorJohn Fastabend <john.r.fastabend@intel.com>
Thu, 1 Nov 2012 05:00:44 +0000 (05:00 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 22 Nov 2012 10:00:42 +0000 (02:00 -0800)
There was a bitwise operation error in the fdb_add block
that was only allowing FDB types that were not permanent.

This was the opposite of the intent because the hardware
never ages out address these are the _only_ type of addrs
that should be allowed.

This was missed because until recently iproute2 did not
set any bit for this by default. And our test code to
manage FDB entries on embedded devices similarly did not
set these bits.

I am going to chalk this up as a bug and fix it now.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

index 4f67fdc0d0d8ecf4a38a9ef3d01e3aa58530dc81..80e3cb7c39e82c13e5a465361e2d20ba238e90b5 100644 (file)
@@ -6954,7 +6954,10 @@ static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
        if (!(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED))
                return -EOPNOTSUPP;
 
-       if (ndm->ndm_state & NUD_PERMANENT) {
+       /* Hardware does not support aging addresses so if a
+        * ndm_state is given only allow permanent addresses
+        */
+       if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) {
                pr_info("%s: FDB only supports static addresses\n",
                        ixgbe_driver_name);
                return -EINVAL;