History

bridge: netlink: export bridge id

Add IFLA_BR_BRIDGE_ID and export br->bridge_id via netlink.

Nikolay Aleksandrov committed 11 years ago

Commit 7599a221 parent 5127c812 files · +8 −2Browse files

Unified · Split

2 files
  1. include/uapi/linux/if_link.h +1 −0
  2. net/bridge/br_netlink.c +7 −2
include/uapi/linux/if_link.h+1−0
@@ -234,6 +234,7 @@ enum { · 233 unmodified lines
234234 IFLA_BR_VLAN_PROTOCOL,
235235 IFLA_BR_GROUP_FWD_MASK,
236236 IFLA_BR_ROOT_ID,
237+ IFLA_BR_BRIDGE_ID,
237238 __IFLA_BR_MAX,
238239 };
239240
net/bridge/br_netlink.c+7−2
@@ -855,6 +855,7 @@ static size_t br_get_size(const struct net_device *brdev) · 854 unmodified lines
855855 #endif
856856 nla_total_size(sizeof(u16)) + /* IFLA_BR_GROUP_FWD_MASK */
857857 nla_total_size(sizeof(struct ifla_bridge_id)) + /* IFLA_BR_ROOT_ID */
858+ nla_total_size(sizeof(struct ifla_bridge_id)) + /* IFLA_BR_BRIDGE_ID */
858859 0;
859860 }
860861
@@ -869,11 +870,14 @@ static int br_fill_info(struct sk_buff *skb, const struct net_device *brdev) · 8 unmodified lines
869870 u16 priority = (br->bridge_id.prio[0] << 8) | br->bridge_id.prio[1];
870871 u16 group_fwd_mask = br->group_fwd_mask;
871872 u8 vlan_enabled = br_vlan_enabled(br);
872− struct ifla_bridge_id root_id;
873+ struct ifla_bridge_id root_id, bridge_id;
873874
875+ memset(&bridge_id, 0, sizeof(bridge_id));
874876 memset(&root_id, 0, sizeof(root_id));
875877 memcpy(root_id.prio, br->designated_root.prio, sizeof(root_id.prio));
876878 memcpy(root_id.addr, br->designated_root.addr, sizeof(root_id.addr));
879+ memcpy(bridge_id.prio, br->bridge_id.prio, sizeof(bridge_id.prio));
880+ memcpy(bridge_id.addr, br->bridge_id.addr, sizeof(bridge_id.addr));
877881
878882 if (nla_put_u32(skb, IFLA_BR_FORWARD_DELAY, forward_delay) ||
879883 nla_put_u32(skb, IFLA_BR_HELLO_TIME, hello_time) ||
@@ -883,7 +887,8 @@ static int br_fill_info(struct sk_buff *skb, const struct net_device *brdev) · 3 unmodified lines
883887 nla_put_u16(skb, IFLA_BR_PRIORITY, priority) ||
884888 nla_put_u8(skb, IFLA_BR_VLAN_FILTERING, vlan_enabled) ||
885889 nla_put_u16(skb, IFLA_BR_GROUP_FWD_MASK, group_fwd_mask) ||
886− nla_put(skb, IFLA_BR_ROOT_ID, sizeof(root_id), &root_id))
890+ nla_put(skb, IFLA_BR_ROOT_ID, sizeof(root_id), &root_id) ||
891+ nla_put(skb, IFLA_BR_BRIDGE_ID, sizeof(bridge_id), &bridge_id))
887892 return -EMSGSIZE;
888893
889894 #ifdef CONFIG_BRIDGE_VLAN_FILTERING

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t