Commit cc1157a5 authored by Tomasz Wlostowski's avatar Tomasz Wlostowski Committed by Alessandro Rubini

userspace/wrsw_rtud/rtud.c: remove disabled ports from broadcast forwarding mask

parent 6190e561
...@@ -60,12 +60,8 @@ static int rtu_create_static_entries() ...@@ -60,12 +60,8 @@ static int rtu_create_static_entries()
hexp_port_list_t plist; hexp_port_list_t plist;
hexp_port_state_t pstate; hexp_port_state_t pstate;
int i, err; int i, err;
uint32_t enabled_port_mask = 0;
// Broadcast MAC
TRACE(TRACE_INFO,"adding static route for broadcast MAC...");
err = rtu_fd_create_entry(bcast_mac, 0, 0xffffffff, STATIC);
if(err)
return err;
// VLAN-aware Bridge reserved addresses (802.1Q-2005 Table 8.1) // VLAN-aware Bridge reserved addresses (802.1Q-2005 Table 8.1)
TRACE(TRACE_INFO,"adding static routes for slow protocols..."); TRACE(TRACE_INFO,"adding static routes for slow protocols...");
...@@ -80,6 +76,7 @@ static int rtu_create_static_entries() ...@@ -80,6 +76,7 @@ static int rtu_create_static_entries()
halexp_query_ports(&plist); halexp_query_ports(&plist);
for(i = 0; i < plist.num_ports; i++) { for(i = 0; i < plist.num_ports; i++) {
halexp_get_port_state(&pstate, plist.port_names[i]); halexp_get_port_state(&pstate, plist.port_names[i]);
enabled_port_mask |= (1 << pstate.hw_index);
TRACE( TRACE(
TRACE_INFO, TRACE_INFO,
"adding static route for port %s index %d [mac %s]", "adding static route for port %s index %d [mac %s]",
...@@ -92,6 +89,12 @@ static int rtu_create_static_entries() ...@@ -92,6 +89,12 @@ static int rtu_create_static_entries()
return err; return err;
} }
// Broadcast MAC
TRACE(TRACE_INFO,"adding static route for broadcast MAC...");
err = rtu_fd_create_entry(bcast_mac, 0, enabled_port_mask | (1 << NIC_PORT), STATIC);
if(err)
return err;
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment