bond: Fix ugly warnings at slave registration.
authorEthan Jackson <ethan@nicira.com>
Mon, 18 Apr 2011 23:17:46 +0000 (16:17 -0700)
committerEthan Jackson <ethan@nicira.com>
Mon, 18 Apr 2011 23:30:30 +0000 (16:30 -0700)
Before this patch, when a slave was registered for this first time
the following warning would display.

interface (null): enabled

This is because the slave was enabled before having its name
configured.

lib/bond.c

index d826c3327482fa3a5093f62709d019af1866456b..d3b0e30a49e18bb838384f0ade994b0b48efcdee 100644 (file)
@@ -376,6 +376,8 @@ bond_slave_register(struct bond *bond, void *slave_, uint16_t stb_id,
         slave->aux = slave_;
         slave->delay_expires = LLONG_MAX;
         slave->up = bond_is_link_up(bond, netdev);
+        slave->name = xstrdup(netdev_get_name(netdev));
+
         slave->enabled = false;
         bond_enable_slave(slave, slave->up, NULL);
     }