Add IFLA_BR_BRIDGE_ID and export br->bridge_id via netlink.
Unified · Split
| @@ -234,6 +234,7 @@ enum { · 233 unmodified lines | ||
| 234 | 234 | IFLA_BR_VLAN_PROTOCOL, |
| 235 | 235 | IFLA_BR_GROUP_FWD_MASK, |
| 236 | 236 | IFLA_BR_ROOT_ID, |
| 237 | + IFLA_BR_BRIDGE_ID, | |
| 237 | 238 | __IFLA_BR_MAX, |
| 238 | 239 | }; |
| 239 | 240 | |
| @@ -855,6 +855,7 @@ static size_t br_get_size(const struct net_device *brdev) · 854 unmodified lines | ||
| 855 | 855 | #endif |
| 856 | 856 | nla_total_size(sizeof(u16)) + /* IFLA_BR_GROUP_FWD_MASK */ |
| 857 | 857 | 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 */ | |
| 858 | 859 | 0; |
| 859 | 860 | } |
| 860 | 861 | |
| @@ -869,11 +870,14 @@ static int br_fill_info(struct sk_buff *skb, const struct net_device *brdev) · 8 unmodified lines | ||
| 869 | 870 | u16 priority = (br->bridge_id.prio[0] << 8) | br->bridge_id.prio[1]; |
| 870 | 871 | u16 group_fwd_mask = br->group_fwd_mask; |
| 871 | 872 | u8 vlan_enabled = br_vlan_enabled(br); |
| 872 | − struct ifla_bridge_id root_id; | |
| 873 | + struct ifla_bridge_id root_id, bridge_id; | |
| 873 | 874 | |
| 875 | + memset(&bridge_id, 0, sizeof(bridge_id)); | |
| 874 | 876 | memset(&root_id, 0, sizeof(root_id)); |
| 875 | 877 | memcpy(root_id.prio, br->designated_root.prio, sizeof(root_id.prio)); |
| 876 | 878 | 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)); | |
| 877 | 881 | |
| 878 | 882 | if (nla_put_u32(skb, IFLA_BR_FORWARD_DELAY, forward_delay) || |
| 879 | 883 | 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 | ||
| 883 | 887 | nla_put_u16(skb, IFLA_BR_PRIORITY, priority) || |
| 884 | 888 | nla_put_u8(skb, IFLA_BR_VLAN_FILTERING, vlan_enabled) || |
| 885 | 889 | 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)) | |
| 887 | 892 | return -EMSGSIZE; |
| 888 | 893 | |
| 889 | 894 | #ifdef CONFIG_BRIDGE_VLAN_FILTERING |