aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2012-10-01 08:32:33 -0400
committerDavid S. Miller <davem@davemloft.net>2012-10-01 18:39:44 -0400
commitedc7d57327bd08bfd04f41531d49b176369db218 (patch)
treec1005cd5c5e9006c4eb2de39b3d14598f2206892
parentde0a41484c47d783dd4d442914815076aa2caac2 (diff)
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 <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c2
-rw-r--r--drivers/net/macvlan.c2
-rw-r--r--include/linux/netdevice.h4
-rw-r--r--net/bridge/br_fdb.c3
-rw-r--r--net/bridge/br_private.h2
-rw-r--r--net/core/rtnetlink.c6
6 files changed, 12 insertions, 7 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 29465be2a14a..0ba6d9561bdb 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -6889,7 +6889,7 @@ static int ixgbe_set_features(struct net_device *netdev,
6889 return 0; 6889 return 0;
6890} 6890}
6891 6891
6892static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, 6892static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
6893 struct net_device *dev, 6893 struct net_device *dev,
6894 const unsigned char *addr, 6894 const unsigned char *addr,
6895 u16 flags) 6895 u16 flags)
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 815dfcfbc7b9..68a43fe602e7 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -546,7 +546,7 @@ static int macvlan_vlan_rx_kill_vid(struct net_device *dev,
546 return 0; 546 return 0;
547} 547}
548 548
549static int macvlan_fdb_add(struct ndmsg *ndm, 549static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
550 struct net_device *dev, 550 struct net_device *dev,
551 const unsigned char *addr, 551 const unsigned char *addr,
552 u16 flags) 552 u16 flags)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index dd320bb22a5a..807a610f193c 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -904,7 +904,8 @@ struct netdev_fcoe_hbainfo {
904 * feature set might be less than what was returned by ndo_fix_features()). 904 * feature set might be less than what was returned by ndo_fix_features()).
905 * Must return >0 or -errno if it changed dev->features itself. 905 * Must return >0 or -errno if it changed dev->features itself.
906 * 906 *
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,
908 * const unsigned char *addr, u16 flags) 909 * const unsigned char *addr, u16 flags)
909 * Adds an FDB entry to dev for addr. 910 * Adds an FDB entry to dev for addr.
910 * int (*ndo_fdb_del)(struct ndmsg *ndm, struct net_device *dev, 911 * int (*ndo_fdb_del)(struct ndmsg *ndm, struct net_device *dev,
@@ -1014,6 +1015,7 @@ struct net_device_ops {
1014 void (*ndo_neigh_destroy)(struct neighbour *n); 1015 void (*ndo_neigh_destroy)(struct neighbour *n);
1015 1016
1016 int (*ndo_fdb_add)(struct ndmsg *ndm, 1017 int (*ndo_fdb_add)(struct ndmsg *ndm,
1018 struct nlattr *tb[],
1017 struct net_device *dev, 1019 struct net_device *dev,
1018 const unsigned char *addr, 1020 const unsigned char *addr,
1019 u16 flags); 1021 u16 flags);
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index 02861190a3d4..d9576e6de2b8 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -608,7 +608,8 @@ static int fdb_add_entry(struct net_bridge_port *source, const __u8 *addr,
608} 608}
609 609
610/* Add new permanent fdb entry with RTM_NEWNEIGH */ 610/* Add new permanent fdb entry with RTM_NEWNEIGH */
611int br_fdb_add(struct ndmsg *ndm, struct net_device *dev, 611int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
612 struct net_device *dev,
612 const unsigned char *addr, u16 nlh_flags) 613 const unsigned char *addr, u16 nlh_flags)
613{ 614{
614 struct net_bridge_port *p; 615 struct net_bridge_port *p;
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 11a984b87e62..9b278c4ebee1 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -364,7 +364,7 @@ extern void br_fdb_update(struct net_bridge *br,
364extern int br_fdb_delete(struct ndmsg *ndm, 364extern int br_fdb_delete(struct ndmsg *ndm,
365 struct net_device *dev, 365 struct net_device *dev,
366 const unsigned char *addr); 366 const unsigned char *addr);
367extern int br_fdb_add(struct ndmsg *nlh, 367extern int br_fdb_add(struct ndmsg *nlh, struct nlattr *tb[],
368 struct net_device *dev, 368 struct net_device *dev,
369 const unsigned char *addr, 369 const unsigned char *addr,
370 u16 nlh_flags); 370 u16 nlh_flags);
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 92575370d9f0..76d4c2c3c89b 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2090,7 +2090,8 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
2090 if ((!ndm->ndm_flags || ndm->ndm_flags & NTF_MASTER) && 2090 if ((!ndm->ndm_flags || ndm->ndm_flags & NTF_MASTER) &&
2091 (dev->priv_flags & IFF_BRIDGE_PORT)) { 2091 (dev->priv_flags & IFF_BRIDGE_PORT)) {
2092 master = dev->master; 2092 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,
2094 nlh->nlmsg_flags); 2095 nlh->nlmsg_flags);
2095 if (err) 2096 if (err)
2096 goto out; 2097 goto out;
@@ -2100,7 +2101,8 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
2100 2101
2101 /* Embedded bridge, macvlan, and any other device support */ 2102 /* Embedded bridge, macvlan, and any other device support */
2102 if ((ndm->ndm_flags & NTF_SELF) && dev->netdev_ops->ndo_fdb_add) { 2103 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,
2104 nlh->nlmsg_flags); 2106 nlh->nlmsg_flags);
2105 2107
2106 if (!err) { 2108 if (!err) {