V5: fix two bugs pointed out by Thomas remove seq check for now, mark it as TODO V4: remove some useless #include some coding style fix V3: drop debugging printk's update selinux perm table as well V2: drop patch 1/2, export ifindex directly Redesign netlink attributes Improve netlink seq check Handle IPv6 addr as well This patch exports bridge multicast database via netlink message type RTM_GETMDB. Similar to fdb, but currently bridge-specific. We may need to support modify multicast database too (RTM_{ADD,DEL}MDB). (Thanks to Thomas for patient reviews)
Showing the changes to include/uapi/linux (2 of 7 files). Show all
Unified · Split
| @@ -116,4 +116,59 @@ enum { · 115 unmodified lines | ||
| 116 | 116 | __IFLA_BRIDGE_MAX, |
| 117 | 117 | }; |
| 118 | 118 | #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1) |
| 119 | + | |
| 120 | +/* Bridge multicast database attributes | |
| 121 | + * [MDBA_MDB] = { | |
| 122 | + * [MDBA_MDB_ENTRY] = { | |
| 123 | + * [MDBA_MDB_ENTRY_INFO] | |
| 124 | + * } | |
| 125 | + * } | |
| 126 | + * [MDBA_ROUTER] = { | |
| 127 | + * [MDBA_ROUTER_PORT] | |
| 128 | + * } | |
| 129 | + */ | |
| 130 | +enum { | |
| 131 | + MDBA_UNSPEC, | |
| 132 | + MDBA_MDB, | |
| 133 | + MDBA_ROUTER, | |
| 134 | + __MDBA_MAX, | |
| 135 | +}; | |
| 136 | +#define MDBA_MAX (__MDBA_MAX - 1) | |
| 137 | + | |
| 138 | +enum { | |
| 139 | + MDBA_MDB_UNSPEC, | |
| 140 | + MDBA_MDB_ENTRY, | |
| 141 | + __MDBA_MDB_MAX, | |
| 142 | +}; | |
| 143 | +#define MDBA_MDB_MAX (__MDBA_MDB_MAX - 1) | |
| 144 | + | |
| 145 | +enum { | |
| 146 | + MDBA_MDB_ENTRY_UNSPEC, | |
| 147 | + MDBA_MDB_ENTRY_INFO, | |
| 148 | + __MDBA_MDB_ENTRY_MAX, | |
| 149 | +}; | |
| 150 | +#define MDBA_MDB_ENTRY_MAX (__MDBA_MDB_ENTRY_MAX - 1) | |
| 151 | + | |
| 152 | +enum { | |
| 153 | + MDBA_ROUTER_UNSPEC, | |
| 154 | + MDBA_ROUTER_PORT, | |
| 155 | + __MDBA_ROUTER_MAX, | |
| 156 | +}; | |
| 157 | +#define MDBA_ROUTER_MAX (__MDBA_ROUTER_MAX - 1) | |
| 158 | + | |
| 159 | +struct br_port_msg { | |
| 160 | + __u32 ifindex; | |
| 161 | +}; | |
| 162 | + | |
| 163 | +struct br_mdb_entry { | |
| 164 | + __u32 ifindex; | |
| 165 | + struct { | |
| 166 | + union { | |
| 167 | + __be32 ip4; | |
| 168 | + struct in6_addr ip6; | |
| 169 | + } u; | |
| 170 | + __be16 proto; | |
| 171 | + } addr; | |
| 172 | +}; | |
| 173 | + | |
| 119 | 174 | #endif /* _UAPI_LINUX_IF_BRIDGE_H */ |
| @@ -125,6 +125,9 @@ enum { · 124 unmodified lines | ||
| 125 | 125 | RTM_GETNETCONF = 82, |
| 126 | 126 | #define RTM_GETNETCONF RTM_GETNETCONF |
| 127 | 127 | |
| 128 | + RTM_GETMDB = 86, | |
| 129 | +#define RTM_GETMDB RTM_GETMDB | |
| 130 | + | |
| 128 | 131 | __RTM_MAX, |
| 129 | 132 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) |
| 130 | 133 | }; |