diff options
author | Nikolay Aleksandrov <nikolay@cumulusnetworks.com> | 2015-10-06 08:11:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-07 07:49:29 -0400 |
commit | 42d452c4b5e7bf0e3024fa9512ec462f70545ae5 (patch) | |
tree | 6bd7eabec0576557bc2ac6b3a434c974a2a23f34 /net/bridge | |
parent | 96f94e7f4a216282a24819968184c881e6343692 (diff) |
bridge: netlink: export port's id and number
Add IFLA_BRPORT_(ID|NO) to allow getting port's port_id and port_no
respectively via netlink.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_netlink.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index 678d22747044..e51332792c3c 100644 --- a/net/bridge/br_netlink.c +++ b/net/bridge/br_netlink.c | |||
@@ -131,6 +131,8 @@ static inline size_t br_port_info_size(void) | |||
131 | + nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_BRIDGE_ID */ | 131 | + nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_BRIDGE_ID */ |
132 | + nla_total_size(sizeof(u16)) /* IFLA_BRPORT_DESIGNATED_PORT */ | 132 | + nla_total_size(sizeof(u16)) /* IFLA_BRPORT_DESIGNATED_PORT */ |
133 | + nla_total_size(sizeof(u16)) /* IFLA_BRPORT_DESIGNATED_COST */ | 133 | + nla_total_size(sizeof(u16)) /* IFLA_BRPORT_DESIGNATED_COST */ |
134 | + nla_total_size(sizeof(u16)) /* IFLA_BRPORT_ID */ | ||
135 | + nla_total_size(sizeof(u16)) /* IFLA_BRPORT_NO */ | ||
134 | + 0; | 136 | + 0; |
135 | } | 137 | } |
136 | 138 | ||
@@ -170,7 +172,9 @@ static int br_port_fill_attrs(struct sk_buff *skb, | |||
170 | nla_put(skb, IFLA_BRPORT_BRIDGE_ID, sizeof(struct ifla_bridge_id), | 172 | nla_put(skb, IFLA_BRPORT_BRIDGE_ID, sizeof(struct ifla_bridge_id), |
171 | &p->designated_bridge) || | 173 | &p->designated_bridge) || |
172 | nla_put_u16(skb, IFLA_BRPORT_DESIGNATED_PORT, p->designated_port) || | 174 | nla_put_u16(skb, IFLA_BRPORT_DESIGNATED_PORT, p->designated_port) || |
173 | nla_put_u16(skb, IFLA_BRPORT_DESIGNATED_COST, p->designated_cost)) | 175 | nla_put_u16(skb, IFLA_BRPORT_DESIGNATED_COST, p->designated_cost) || |
176 | nla_put_u16(skb, IFLA_BRPORT_ID, p->port_id) || | ||
177 | nla_put_u16(skb, IFLA_BRPORT_NO, p->port_no)) | ||
174 | return -EMSGSIZE; | 178 | return -EMSGSIZE; |
175 | 179 | ||
176 | return 0; | 180 | return 0; |