diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-05-07 05:17:13 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-07 05:17:34 -0400 |
commit | 44347d947f628060b92449702071bfe1d31dfb75 (patch) | |
tree | c6ed74610d5b3295df4296659f80f5feb94b28cc /drivers/net/bonding/bond_sysfs.c | |
parent | d94fc523f3c35bd8013f04827e94756cbc0212f4 (diff) | |
parent | 413f81eba35d6ede9289b0c8a920c013a84fac71 (diff) |
Merge branch 'linus' into tracing/core
Merge reason: tracing/core was on a .30-rc1 base and was missing out on
on a handful of tracing fixes present in .30-rc5-almost.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/net/bonding/bond_sysfs.c')
-rw-r--r-- | drivers/net/bonding/bond_sysfs.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 18cf4787874c..d28731535226 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -684,17 +684,15 @@ static ssize_t bonding_store_arp_targets(struct device *d, | |||
684 | goto out; | 684 | goto out; |
685 | } | 685 | } |
686 | /* look for an empty slot to put the target in, and check for dupes */ | 686 | /* look for an empty slot to put the target in, and check for dupes */ |
687 | for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) { | 687 | for (i = 0; (i < BOND_MAX_ARP_TARGETS) && !done; i++) { |
688 | if (targets[i] == newtarget) { /* duplicate */ | 688 | if (targets[i] == newtarget) { /* duplicate */ |
689 | printk(KERN_ERR DRV_NAME | 689 | printk(KERN_ERR DRV_NAME |
690 | ": %s: ARP target %pI4 is already present\n", | 690 | ": %s: ARP target %pI4 is already present\n", |
691 | bond->dev->name, &newtarget); | 691 | bond->dev->name, &newtarget); |
692 | if (done) | ||
693 | targets[i] = 0; | ||
694 | ret = -EINVAL; | 692 | ret = -EINVAL; |
695 | goto out; | 693 | goto out; |
696 | } | 694 | } |
697 | if (targets[i] == 0 && !done) { | 695 | if (targets[i] == 0) { |
698 | printk(KERN_INFO DRV_NAME | 696 | printk(KERN_INFO DRV_NAME |
699 | ": %s: adding ARP target %pI4.\n", | 697 | ": %s: adding ARP target %pI4.\n", |
700 | bond->dev->name, &newtarget); | 698 | bond->dev->name, &newtarget); |
@@ -720,12 +718,16 @@ static ssize_t bonding_store_arp_targets(struct device *d, | |||
720 | goto out; | 718 | goto out; |
721 | } | 719 | } |
722 | 720 | ||
723 | for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) { | 721 | for (i = 0; (i < BOND_MAX_ARP_TARGETS) && !done; i++) { |
724 | if (targets[i] == newtarget) { | 722 | if (targets[i] == newtarget) { |
723 | int j; | ||
725 | printk(KERN_INFO DRV_NAME | 724 | printk(KERN_INFO DRV_NAME |
726 | ": %s: removing ARP target %pI4.\n", | 725 | ": %s: removing ARP target %pI4.\n", |
727 | bond->dev->name, &newtarget); | 726 | bond->dev->name, &newtarget); |
728 | targets[i] = 0; | 727 | for (j = i; (j < (BOND_MAX_ARP_TARGETS-1)) && targets[j+1]; j++) |
728 | targets[j] = targets[j+1]; | ||
729 | |||
730 | targets[j] = 0; | ||
729 | done = 1; | 731 | done = 1; |
730 | } | 732 | } |
731 | } | 733 | } |