diff options
author | Holger Eitzenberger <holger@eitzenberger.org> | 2008-12-18 06:08:14 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-18 06:08:14 +0300 |
commit | b99d6ba96d814dab06671029948f22995d603d7b (patch) | |
tree | 8748699b0455f60c2fc9cecfb512df5e0a3107a7 /drivers/net/bonding/bond_3ad.c | |
parent | 1055c9aba3b6850245fe3bbb533d4747e7f904bf (diff) | |
download | linux-b99d6ba96d814dab06671029948f22995d603d7b.tar.xz |
bonding: use port_params in __record_pdu()
It helps in maintaining the various partner information values from
the LACPDU. It also removes the pointless comment at the top.
Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_3ad.c')
-rw-r--r-- | drivers/net/bonding/bond_3ad.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index d02e852afbd9..b789dcb77626 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c @@ -483,24 +483,25 @@ static u16 __ad_timer_to_ticks(u16 timer_type, u16 par) */ static void __record_pdu(struct lacpdu *lacpdu, struct port *port) { - // validate lacpdu and port if (lacpdu && port) { + struct port_params *partner = &port->partner_oper; + // record the new parameter values for the partner operational - port->partner_oper.port_number = ntohs(lacpdu->actor_port); - port->partner_oper.port_priority = ntohs(lacpdu->actor_port_priority); - port->partner_oper.system = lacpdu->actor_system; - port->partner_oper.system_priority = ntohs(lacpdu->actor_system_priority); - port->partner_oper.key = ntohs(lacpdu->actor_key); - port->partner_oper.port_state = lacpdu->actor_state; + partner->port_number = ntohs(lacpdu->actor_port); + partner->port_priority = ntohs(lacpdu->actor_port_priority); + partner->system = lacpdu->actor_system; + partner->system_priority = ntohs(lacpdu->actor_system_priority); + partner->key = ntohs(lacpdu->actor_key); + partner->port_state = lacpdu->actor_state; // set actor_oper_port_state.defaulted to FALSE port->actor_oper_port_state &= ~AD_STATE_DEFAULTED; // set the partner sync. to on if the partner is sync. and the port is matched if ((port->sm_vars & AD_PORT_MATCHED) && (lacpdu->actor_state & AD_STATE_SYNCHRONIZATION)) { - port->partner_oper.port_state |= AD_STATE_SYNCHRONIZATION; + partner->port_state |= AD_STATE_SYNCHRONIZATION; } else { - port->partner_oper.port_state &= ~AD_STATE_SYNCHRONIZATION; + partner->port_state &= ~AD_STATE_SYNCHRONIZATION; } } } |