diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-05-02 19:53:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-02 19:53:33 -0400 |
commit | ae4f8fca4030a4e783fa4ccb0c9d8d8a8cf60a32 (patch) | |
tree | d2886fa956395043efa25bd1aebb93da27162b78 | |
parent | 920e37f76b19b4a3d8a1a3144cd6ee24e0e7f5b4 (diff) |
bridge: forwarding table information for >256 devices
The forwarding table binary interface (my bad choice), only exposes
the port number of the first 8 bits. The bridge code was limited to
256 ports at the time, but now the kernel supports up 1024 ports, so
the upper bits are lost when doing:
brctl showmacs
The fix is to squeeze the extra bits into small hole left in data
structure, to maintain binary compatiablity.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/if_bridge.h | 4 | ||||
-rw-r--r-- | net/bridge/br_fdb.c | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h index 58e43e566457..950e13d09e06 100644 --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h | |||
@@ -97,7 +97,9 @@ struct __fdb_entry | |||
97 | __u8 port_no; | 97 | __u8 port_no; |
98 | __u8 is_local; | 98 | __u8 is_local; |
99 | __u32 ageing_timer_value; | 99 | __u32 ageing_timer_value; |
100 | __u32 unused; | 100 | __u8 port_hi; |
101 | __u8 pad0; | ||
102 | __u16 unused; | ||
101 | }; | 103 | }; |
102 | 104 | ||
103 | #ifdef __KERNEL__ | 105 | #ifdef __KERNEL__ |
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index 9326c377822e..72c5976a5ce3 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c | |||
@@ -285,7 +285,11 @@ int br_fdb_fillbuf(struct net_bridge *br, void *buf, | |||
285 | 285 | ||
286 | /* convert from internal format to API */ | 286 | /* convert from internal format to API */ |
287 | memcpy(fe->mac_addr, f->addr.addr, ETH_ALEN); | 287 | memcpy(fe->mac_addr, f->addr.addr, ETH_ALEN); |
288 | |||
289 | /* due to ABI compat need to split into hi/lo */ | ||
288 | fe->port_no = f->dst->port_no; | 290 | fe->port_no = f->dst->port_no; |
291 | fe->port_hi = f->dst->port_no >> 8; | ||
292 | |||
289 | fe->is_local = f->is_local; | 293 | fe->is_local = f->is_local; |
290 | if (!f->is_static) | 294 | if (!f->is_static) |
291 | fe->ageing_timer_value = jiffies_to_clock_t(jiffies - f->ageing_timer); | 295 | fe->ageing_timer_value = jiffies_to_clock_t(jiffies - f->ageing_timer); |