netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bridge: Correctly encode addresses when dumping mdb entries
@ 2012-12-18 21:54 Vlad Yasevich
  2012-12-19  7:11 ` Cong Wang
  2012-12-19 20:50 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Vlad Yasevich @ 2012-12-18 21:54 UTC (permalink / raw)
  To: netdev; +Cc: davem, shemminger

When dumping mdb table, set the addresses the kernel returns
based on the address protocol type.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
---
 net/bridge/br_mdb.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c
index 9cf5d2b..ac22bb2 100644
--- a/net/bridge/br_mdb.c
+++ b/net/bridge/br_mdb.c
@@ -84,9 +84,11 @@ static int br_mdb_fill_info(struct sk_buff *skb, struct netlink_callback *cb,
 					struct br_mdb_entry e;
 					e.ifindex = port->dev->ifindex;
 					e.state = p->state;
-					e.addr.u.ip4 = p->addr.u.ip4;
+					if (p->addr.proto == htons(ETH_P_IP))
+						e.addr.u.ip4 = p->addr.u.ip4;
 #if IS_ENABLED(CONFIG_IPV6)
-					e.addr.u.ip6 = p->addr.u.ip6;
+					if (p->addr.proto == htons(ETH_P_IPV6))
+						e.addr.u.ip6 = p->addr.u.ip6;
 #endif
 					e.addr.proto = p->addr.proto;
 					if (nla_put(skb, MDBA_MDB_ENTRY_INFO, sizeof(e), &e)) {
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] bridge: Correctly encode addresses when dumping mdb entries
  2012-12-18 21:54 [PATCH] bridge: Correctly encode addresses when dumping mdb entries Vlad Yasevich
@ 2012-12-19  7:11 ` Cong Wang
  2012-12-19 20:50 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Cong Wang @ 2012-12-19  7:11 UTC (permalink / raw)
  To: netdev

On Tue, 18 Dec 2012 at 21:54 GMT, Vlad Yasevich <vyasevic@redhat.com> wrote:
> When dumping mdb table, set the addresses the kernel returns
> based on the address protocol type.
>
> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>

Looks good.

Acked-by: Cong Wang <amwang@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] bridge: Correctly encode addresses when dumping mdb entries
  2012-12-18 21:54 [PATCH] bridge: Correctly encode addresses when dumping mdb entries Vlad Yasevich
  2012-12-19  7:11 ` Cong Wang
@ 2012-12-19 20:50 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2012-12-19 20:50 UTC (permalink / raw)
  To: vyasevic; +Cc: netdev, shemminger

From: Vlad Yasevich <vyasevic@redhat.com>
Date: Tue, 18 Dec 2012 16:54:08 -0500

> When dumping mdb table, set the addresses the kernel returns
> based on the address protocol type.
> 
> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-19 20:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-18 21:54 [PATCH] bridge: Correctly encode addresses when dumping mdb entries Vlad Yasevich
2012-12-19  7:11 ` Cong Wang
2012-12-19 20:50 ` David Miller

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).