netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vlad Yasevich <vyasevic@redhat.com>
To: netdev@vger.kernel.org
Cc: shemminger@vyatta.com, Vlad Yasevich <vyasevic@redhat.com>
Subject: [RFC PATCHv2 bridge 5/7] bridge: Add vlan support to static neighbors
Date: Wed, 19 Sep 2012 08:42:14 -0400	[thread overview]
Message-ID: <1348058536-22607-6-git-send-email-vyasevic@redhat.com> (raw)
In-Reply-To: <1348058536-22607-1-git-send-email-vyasevic@redhat.com>

---
 include/linux/neighbour.h |    2 +-
 net/bridge/br_fdb.c       |   12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/linux/neighbour.h b/include/linux/neighbour.h
index 275e5d6..044df8f 100644
--- a/include/linux/neighbour.h
+++ b/include/linux/neighbour.h
@@ -7,7 +7,7 @@
 struct ndmsg {
 	__u8		ndm_family;
 	__u8		ndm_pad1;
-	__u16		ndm_pad2;
+	__u16		ndm_vlan;
 	__s32		ndm_ifindex;
 	__u16		ndm_state;
 	__u8		ndm_flags;
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index e17f9f2..3c21a3d 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -493,7 +493,7 @@ static int fdb_fill_info(struct sk_buff *skb, const struct net_bridge *br,
 	ndm = nlmsg_data(nlh);
 	ndm->ndm_family	 = AF_BRIDGE;
 	ndm->ndm_pad1    = 0;
-	ndm->ndm_pad2    = 0;
+	ndm->ndm_vlan    = fdb->vlan_id;
 	ndm->ndm_flags	 = 0;
 	ndm->ndm_type	 = 0;
 	ndm->ndm_ifindex = fdb->dst ? fdb->dst->dev->ifindex : br->dev->ifindex;
@@ -640,25 +640,25 @@ int br_fdb_add(struct ndmsg *ndm, struct net_device *dev,
 
 	if (ndm->ndm_flags & NTF_USE) {
 		rcu_read_lock();
-		br_fdb_update(p->br, p, addr, 0);
+		br_fdb_update(p->br, p, addr, ndm->ndm_vlan);
 		rcu_read_unlock();
 	} else {
 		spin_lock_bh(&p->br->hash_lock);
 		err = fdb_add_entry(p, addr, ndm->ndm_state, nlh_flags,
-				0);
+				ndm->ndm_vlan);
 		spin_unlock_bh(&p->br->hash_lock);
 	}
 
 	return err;
 }
 
-static int fdb_delete_by_addr(struct net_bridge_port *p, u8 *addr)
+static int fdb_delete_by_addr(struct net_bridge_port *p, u8 *addr, u16 vlan)
 {
 	struct net_bridge *br = p->br;
 	struct hlist_head *head = &br->hash[br_mac_hash(addr, 0)];
 	struct net_bridge_fdb_entry *fdb;
 
-	fdb = fdb_find(head, addr, 0);
+	fdb = fdb_find(head, addr, vlan);
 	if (!fdb)
 		return -ENOENT;
 
@@ -681,7 +681,7 @@ int br_fdb_delete(struct ndmsg *ndm, struct net_device *dev,
 	}
 
 	spin_lock_bh(&p->br->hash_lock);
-	err = fdb_delete_by_addr(p, addr);
+	err = fdb_delete_by_addr(p, addr, ndm->ndm_vlan);
 	spin_unlock_bh(&p->br->hash_lock);
 
 	return err;
-- 
1.7.7.6

  parent reply	other threads:[~2012-09-19 12:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-19 12:42 [RFC PATCHv2 bridge 0/7] Add basic VLAN support to bridges Vlad Yasevich
2012-09-19 12:42 ` [RFC PATCHv2 bridge 1/7] bridge: Add vlan check to forwarding path Vlad Yasevich
2012-09-19 12:42 ` [RFC PATCHv2 bridge 2/7] bridge: Add vlan to unicast fdb entries Vlad Yasevich
2012-09-22 17:17   ` Ben Hutchings
2012-09-24 13:56     ` Vlad Yasevich
2012-09-19 12:42 ` [RFC PATCHv2 bridge 3/7] bridge: Add vlan id to multicast groups Vlad Yasevich
2012-09-19 12:42 ` [RFC PATCHv2 bridge 4/7] bridge: Add netlink interface to configure vlans on bridge ports Vlad Yasevich
2012-09-22 17:17   ` Ben Hutchings
2012-09-19 12:42 ` Vlad Yasevich [this message]
2012-09-19 15:20   ` [RFC PATCHv2 bridge 5/7] bridge: Add vlan support to static neighbors John Fastabend
2012-09-19 15:24     ` Vlad Yasevich
2012-09-19 12:42 ` [RFC PATCHv2 bridge 6/7] bridge: Add sysfs interface to display VLANS Vlad Yasevich
2012-09-19 12:42 ` [RFC PATCHv2 bridge 7/7] bridge: Add the ability to show dump the vlan map from a bridge port Vlad Yasevich
2012-09-22 17:15   ` Ben Hutchings
2012-09-22 17:27     ` David Miller
2012-09-22 20:05       ` Stephen Hemminger
2012-09-24 13:49         ` Vlad Yasevich
2012-09-24 18:39           ` Ben Hutchings
2012-09-24 20:29             ` Vlad Yasevich
2012-09-24 13:48     ` Vlad Yasevich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1348058536-22607-6-git-send-email-vyasevic@redhat.com \
    --to=vyasevic@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).