Patchwork [4/9] bonding: use plain memcpy in __record_default()

login
register
mail settings
Submitter holger@eitzenberger.org
Date Dec. 17, 2008, 9:28 p.m.
Message ID <20081217213011.268895930@jonathan.eitzenberger.org>
Download mbox | patch
Permalink /patch/14562/
State Accepted
Delegated to: David Miller
Headers show

Comments

holger@eitzenberger.org - Dec. 17, 2008, 9:28 p.m.
Also remove the pointless comment at the top.

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>

Patch

Index: bonding-2.6/drivers/net/bonding/bond_3ad.c
===================================================================
--- bonding-2.6.orig/drivers/net/bonding/bond_3ad.c
+++ bonding-2.6/drivers/net/bonding/bond_3ad.c
@@ -516,15 +516,10 @@  static void __record_pdu(struct lacpdu *
  */
 static void __record_default(struct port *port)
 {
-	// validate the port
 	if (port) {
 		// record the partner admin parameters
-		port->partner_oper.port_number = port->partner_admin.port_number;
-		port->partner_oper.port_priority = port->partner_admin.port_priority;
-		port->partner_oper.system = port->partner_admin.system;
-		port->partner_oper.system_priority = port->partner_admin.system_priority;
-		port->partner_oper.key = port->partner_admin.key;
-		port->partner_oper.port_state = port->partner_admin.port_state;
+		memcpy(&port->partner_oper, &port->partner_admin,
+		       sizeof(struct port_params));
 
 		// set actor_oper_port_state.defaulted to true
 		port->actor_oper_port_state |= AD_STATE_DEFAULTED;