diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2015-09-29 12:07:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-09-29 21:31:59 -0700 |
commit | e02a06b2a7c6e8b43c60ed8e0181172231af13d7 (patch) | |
tree | 39b1c8ce892da55be97c2dead2fa046dad516ddd /net/switchdev | |
parent | e23b002b23dfdcd12ca982fbc57dcb071a1fee62 (diff) | |
download | linux-stable-e02a06b2a7c6e8b43c60ed8e0181172231af13d7.tar.gz linux-stable-e02a06b2a7c6e8b43c60ed8e0181172231af13d7.tar.bz2 linux-stable-e02a06b2a7c6e8b43c60ed8e0181172231af13d7.zip |
net: switchdev: move dev in switchdev_fdb_dump
The FDB dump callback requires the related net_device so move it to the
struct switchdev_fdb_dump superset instead of using a callback param.
With this done, it'll be simpler to change the dump function signature.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/switchdev')
-rw-r--r-- | net/switchdev/switchdev.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index 56d34edc7442..c0e2047f8984 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c @@ -858,6 +858,7 @@ EXPORT_SYMBOL_GPL(switchdev_port_fdb_del); struct switchdev_fdb_dump { struct switchdev_obj obj; + struct net_device *dev; struct sk_buff *skb; struct netlink_callback *cb; int idx; @@ -887,7 +888,7 @@ static int switchdev_port_fdb_dump_cb(struct net_device *dev, ndm->ndm_pad2 = 0; ndm->ndm_flags = NTF_SELF; ndm->ndm_type = 0; - ndm->ndm_ifindex = dev->ifindex; + ndm->ndm_ifindex = dump->dev->ifindex; ndm->ndm_state = obj->u.fdb.ndm_state; if (nla_put(dump->skb, NDA_LLADDR, ETH_ALEN, obj->u.fdb.addr)) @@ -927,6 +928,7 @@ int switchdev_port_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, .id = SWITCHDEV_OBJ_PORT_FDB, .cb = switchdev_port_fdb_dump_cb, }, + .dev = dev, .skb = skb, .cb = cb, .idx = idx, |