Skip to content

Commit edc7d57

Browse files
stephen hemmingerdavem330
authored andcommitted
netlink: add attributes to fdb interface
Later changes need to be able to refer to neighbour attributes when doing fdb_add. Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent de0a414 commit edc7d57

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6889,7 +6889,7 @@ static int ixgbe_set_features(struct net_device *netdev,
68896889
return 0;
68906890
}
68916891

6892-
static int ixgbe_ndo_fdb_add(struct ndmsg *ndm,
6892+
static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
68936893
struct net_device *dev,
68946894
const unsigned char *addr,
68956895
u16 flags)

drivers/net/macvlan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ static int macvlan_vlan_rx_kill_vid(struct net_device *dev,
546546
return 0;
547547
}
548548

549-
static int macvlan_fdb_add(struct ndmsg *ndm,
549+
static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
550550
struct net_device *dev,
551551
const unsigned char *addr,
552552
u16 flags)

include/linux/netdevice.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,8 @@ struct netdev_fcoe_hbainfo {
904904
* feature set might be less than what was returned by ndo_fix_features()).
905905
* Must return >0 or -errno if it changed dev->features itself.
906906
*
907-
* int (*ndo_fdb_add)(struct ndmsg *ndm, struct net_device *dev,
907+
* int (*ndo_fdb_add)(struct ndmsg *ndm, struct nlattr *tb[],
908+
* struct net_device *dev,
908909
* const unsigned char *addr, u16 flags)
909910
* Adds an FDB entry to dev for addr.
910911
* int (*ndo_fdb_del)(struct ndmsg *ndm, struct net_device *dev,
@@ -1014,6 +1015,7 @@ struct net_device_ops {
10141015
void (*ndo_neigh_destroy)(struct neighbour *n);
10151016

10161017
int (*ndo_fdb_add)(struct ndmsg *ndm,
1018+
struct nlattr *tb[],
10171019
struct net_device *dev,
10181020
const unsigned char *addr,
10191021
u16 flags);

net/bridge/br_fdb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,8 @@ static int fdb_add_entry(struct net_bridge_port *source, const __u8 *addr,
608608
}
609609

610610
/* Add new permanent fdb entry with RTM_NEWNEIGH */
611-
int br_fdb_add(struct ndmsg *ndm, struct net_device *dev,
611+
int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
612+
struct net_device *dev,
612613
const unsigned char *addr, u16 nlh_flags)
613614
{
614615
struct net_bridge_port *p;

net/bridge/br_private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ extern void br_fdb_update(struct net_bridge *br,
364364
extern int br_fdb_delete(struct ndmsg *ndm,
365365
struct net_device *dev,
366366
const unsigned char *addr);
367-
extern int br_fdb_add(struct ndmsg *nlh,
367+
extern int br_fdb_add(struct ndmsg *nlh, struct nlattr *tb[],
368368
struct net_device *dev,
369369
const unsigned char *addr,
370370
u16 nlh_flags);

net/core/rtnetlink.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,7 +2090,8 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
20902090
if ((!ndm->ndm_flags || ndm->ndm_flags & NTF_MASTER) &&
20912091
(dev->priv_flags & IFF_BRIDGE_PORT)) {
20922092
master = dev->master;
2093-
err = master->netdev_ops->ndo_fdb_add(ndm, dev, addr,
2093+
err = master->netdev_ops->ndo_fdb_add(ndm, tb,
2094+
dev, addr,
20942095
nlh->nlmsg_flags);
20952096
if (err)
20962097
goto out;
@@ -2100,7 +2101,8 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
21002101

21012102
/* Embedded bridge, macvlan, and any other device support */
21022103
if ((ndm->ndm_flags & NTF_SELF) && dev->netdev_ops->ndo_fdb_add) {
2103-
err = dev->netdev_ops->ndo_fdb_add(ndm, dev, addr,
2104+
err = dev->netdev_ops->ndo_fdb_add(ndm, tb,
2105+
dev, addr,
21042106
nlh->nlmsg_flags);
21052107

21062108
if (!err) {

0 commit comments

Comments
 (0)