From: Nikolay Aleksandrov <razor@blackwall.org>
To: netdev@vger.kernel.org
Cc: bridge@lists.linux-foundation.org,
Nikolay Aleksandrov <nikolay@cumulusnetworks.com>,
roopa@cumulusnetworks.com, shm@cumulusnetworks.com,
davem@davemloft.net
Subject: [PATCH net-next 2/8] bridge: netlink: export port's bridge id
Date: Tue, 6 Oct 2015 14:11:56 +0200 [thread overview]
Message-ID: <1444133522-16907-3-git-send-email-razor@blackwall.org> (raw)
In-Reply-To: <1444133522-16907-1-git-send-email-razor@blackwall.org>
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Add IFLA_BRPORT_BRIDGE_ID to allow getting the designated bridge id via
netlink.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
include/uapi/linux/if_link.h | 1 +
net/bridge/br_netlink.c | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index c45c1d7894e7..e891c32c9993 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -293,6 +293,7 @@ enum {
IFLA_BRPORT_LEARNING_SYNC, /* mac learning sync from device */
IFLA_BRPORT_PROXYARP_WIFI, /* proxy ARP for Wi-Fi */
IFLA_BRPORT_ROOT_ID, /* designated root */
+ IFLA_BRPORT_BRIDGE_ID, /* designated bridge */
__IFLA_BRPORT_MAX
};
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index cad4050310ee..c3e0b73d660d 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -128,6 +128,7 @@ static inline size_t br_port_info_size(void)
+ nla_total_size(1) /* IFLA_BRPORT_PROXYARP */
+ nla_total_size(1) /* IFLA_BRPORT_PROXYARP_WIFI */
+ nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_ROOT_ID */
+ + nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_BRIDGE_ID */
+ 0;
}
@@ -163,7 +164,9 @@ static int br_port_fill_attrs(struct sk_buff *skb,
nla_put_u8(skb, IFLA_BRPORT_PROXYARP_WIFI,
!!(p->flags & BR_PROXYARP_WIFI)) ||
nla_put(skb, IFLA_BRPORT_ROOT_ID, sizeof(struct ifla_bridge_id),
- &p->designated_root))
+ &p->designated_root) ||
+ nla_put(skb, IFLA_BRPORT_BRIDGE_ID, sizeof(struct ifla_bridge_id),
+ &p->designated_bridge))
return -EMSGSIZE;
return 0;
--
2.4.3
next prev parent reply other threads:[~2015-10-06 12:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-06 12:11 [PATCH net-next 0/8] bridge: netlink: complete port attribute support Nikolay Aleksandrov
2015-10-06 12:11 ` [PATCH net-next 1/8] bridge: netlink: export port's root id Nikolay Aleksandrov
2015-10-06 12:30 ` kbuild test robot
2015-10-06 12:43 ` Nikolay Aleksandrov
2015-10-06 12:30 ` kbuild test robot
2015-10-06 12:11 ` Nikolay Aleksandrov [this message]
2015-10-06 12:11 ` [PATCH net-next 3/8] bridge: netlink: export port's designated cost and port Nikolay Aleksandrov
2015-10-06 12:11 ` [PATCH net-next 4/8] bridge: netlink: export port's id and number Nikolay Aleksandrov
2015-10-06 12:11 ` [PATCH net-next 5/8] bridge: netlink: export port's topology_change_ack and config_pending Nikolay Aleksandrov
2015-10-06 12:12 ` [PATCH net-next 6/8] bridge: netlink: export port's timer values Nikolay Aleksandrov
2015-10-06 12:12 ` [PATCH net-next 7/8] bridge: netlink: allow to flush port's fdb Nikolay Aleksandrov
2015-10-06 12:12 ` [PATCH net-next 8/8] bridge: netlink: add support for port's multicast_router attribute Nikolay Aleksandrov
2015-10-07 11:50 ` [PATCH net-next 0/8] bridge: netlink: complete port attribute support David Miller
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=1444133522-16907-3-git-send-email-razor@blackwall.org \
--to=razor@blackwall.org \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
--cc=roopa@cumulusnetworks.com \
--cc=shm@cumulusnetworks.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).