mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-15 21:23:23 +00:00
bonding: use port_params in __update_default_selected()
I also removed some of the unneeded braces in the if condition to improve readability and a little bit of reformatting. Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ce6a49ad40
commit
3c52065fbb
@ -543,16 +543,18 @@ static void __update_selected(struct lacpdu *lacpdu, struct port *port)
|
|||||||
*/
|
*/
|
||||||
static void __update_default_selected(struct port *port)
|
static void __update_default_selected(struct port *port)
|
||||||
{
|
{
|
||||||
// validate the port
|
|
||||||
if (port) {
|
if (port) {
|
||||||
|
const struct port_params *admin = &port->partner_admin;
|
||||||
|
const struct port_params *oper = &port->partner_oper;
|
||||||
|
|
||||||
// check if any parameter is different
|
// check if any parameter is different
|
||||||
if ((port->partner_admin.port_number != port->partner_oper.port_number) ||
|
if (admin->port_number != oper->port_number
|
||||||
(port->partner_admin.port_priority != port->partner_oper.port_priority) ||
|
|| admin->port_priority != oper->port_priority
|
||||||
MAC_ADDRESS_COMPARE(&(port->partner_admin.system), &(port->partner_oper.system)) ||
|
|| MAC_ADDRESS_COMPARE(&admin->system, &oper->system)
|
||||||
(port->partner_admin.system_priority != port->partner_oper.system_priority) ||
|
|| admin->system_priority != oper->system_priority
|
||||||
(port->partner_admin.key != port->partner_oper.key) ||
|
|| admin->key != oper->key
|
||||||
((port->partner_admin.port_state & AD_STATE_AGGREGATION) != (port->partner_oper.port_state & AD_STATE_AGGREGATION))
|
|| (admin->port_state & AD_STATE_AGGREGATION)
|
||||||
) {
|
!= (oper->port_state & AD_STATE_AGGREGATION)) {
|
||||||
// update the state machine Selected variable
|
// update the state machine Selected variable
|
||||||
port->sm_vars &= ~AD_PORT_SELECTED;
|
port->sm_vars &= ~AD_PORT_SELECTED;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user