aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_sysfs.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-19 18:50:47 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-19 18:50:47 -0500
commit1ee2dcc2245340cf4ac94b99c4d00efbeba61824 (patch)
tree5339e55add987379525177011dde6e3756b1430c /drivers/net/bonding/bond_sysfs.c
parent4457e6f6c9f6052cd5f44a79037108b5ddeb0ce7 (diff)
parent091e0662ee2c37867ad918ce7b6ddd17f0e090e2 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Mostly these are fixes for fallout due to merge window changes, as well as cures for problems that have been with us for a much longer period of time" 1) Johannes Berg noticed two major deficiencies in our genetlink registration. Some genetlink protocols we passing in constant counts for their ops array rather than something like ARRAY_SIZE(ops) or similar. Also, some genetlink protocols were using fixed IDs for their multicast groups. We have to retain these fixed IDs to keep existing userland tools working, but reserve them so that other multicast groups used by other protocols can not possibly conflict. In dealing with these two problems, we actually now use less state management for genetlink operations and multicast groups. 2) When configuring interface hardware timestamping, fix several drivers that simply do not validate that the hwtstamp_config value is one the driver actually supports. From Ben Hutchings. 3) Invalid memory references in mwifiex driver, from Amitkumar Karwar. 4) In dev_forward_skb(), set the skb->protocol in the right order relative to skb_scrub_packet(). From Alexei Starovoitov. 5) Bridge erroneously fails to use the proper wrapper functions to make calls to netdev_ops->ndo_vlan_rx_{add,kill}_vid. Fix from Toshiaki Makita. 6) When detaching a bridge port, make sure to flush all VLAN IDs to prevent them from leaking, also from Toshiaki Makita. 7) Put in a compromise for TCP Small Queues so that deep queued devices that delay TX reclaim non-trivially don't have such a performance decrease. One particularly problematic area is 802.11 AMPDU in wireless. From Eric Dumazet. 8) Fix crashes in tcp_fastopen_cache_get(), we can see NULL socket dsts here. Fix from Eric Dumzaet, reported by Dave Jones. 9) Fix use after free in ipv6 SIT driver, from Willem de Bruijn. 10) When computing mergeable buffer sizes, virtio-net fails to take the virtio-net header into account. From Michael Dalton. 11) Fix seqlock deadlock in ip4_datagram_connect() wrt. statistic bumping, this one has been with us for a while. From Eric Dumazet. 12) Fix NULL deref in the new TIPC fragmentation handling, from Erik Hugne. 13) 6lowpan bit used for traffic classification was wrong, from Jukka Rissanen. 14) macvlan has the same issue as normal vlans did wrt. propagating LRO disabling down to the real device, fix it the same way. From Michal Kubecek. 15) CPSW driver needs to soft reset all slaves during suspend, from Daniel Mack. 16) Fix small frame pacing in FQ packet scheduler, from Eric Dumazet. 17) The xen-netfront RX buffer refill timer isn't properly scheduled on partial RX allocation success, from Ma JieYue. 18) When ipv6 ping protocol support was added, the AF_INET6 protocol initialization cleanup path on failure was borked a little. Fix from Vlad Yasevich. 19) If a socket disconnects during a read/recvmsg/recvfrom/etc that blocks we can do the wrong thing with the msg_name we write back to userspace. From Hannes Frederic Sowa. There is another fix in the works from Hannes which will prevent future problems of this nature. 20) Fix route leak in VTI tunnel transmit, from Fan Du. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (106 commits) genetlink: make multicast groups const, prevent abuse genetlink: pass family to functions using groups genetlink: add and use genl_set_err() genetlink: remove family pointer from genl_multicast_group genetlink: remove genl_unregister_mc_group() hsr: don't call genl_unregister_mc_group() quota/genetlink: use proper genetlink multicast APIs drop_monitor/genetlink: use proper genetlink multicast APIs genetlink: only pass array to genl_register_family_with_ops() tcp: don't update snd_nxt, when a socket is switched from repair mode atm: idt77252: fix dev refcnt leak xfrm: Release dst if this dst is improper for vti tunnel netlink: fix documentation typo in netlink_set_err() be2net: Delete secondary unicast MAC addresses during be_close be2net: Fix unconditional enabling of Rx interface options net, virtio_net: replace the magic value ping: prevent NULL pointer dereference on write to msg_name bnx2x: Prevent "timeout waiting for state X" bnx2x: prevent CFC attention bnx2x: Prevent panic during DMAE timeout ...
Diffstat (limited to 'drivers/net/bonding/bond_sysfs.c')
-rw-r--r--drivers/net/bonding/bond_sysfs.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index bc8fd362a5aa..0ec2a7e8c8a9 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -524,8 +524,9 @@ static ssize_t bonding_store_arp_interval(struct device *d,
524 goto out; 524 goto out;
525 } 525 }
526 if (bond->params.mode == BOND_MODE_ALB || 526 if (bond->params.mode == BOND_MODE_ALB ||
527 bond->params.mode == BOND_MODE_TLB) { 527 bond->params.mode == BOND_MODE_TLB ||
528 pr_info("%s: ARP monitoring cannot be used with ALB/TLB. Only MII monitoring is supported on %s.\n", 528 bond->params.mode == BOND_MODE_8023AD) {
529 pr_info("%s: ARP monitoring cannot be used with ALB/TLB/802.3ad. Only MII monitoring is supported on %s.\n",
529 bond->dev->name, bond->dev->name); 530 bond->dev->name, bond->dev->name);
530 ret = -EINVAL; 531 ret = -EINVAL;
531 goto out; 532 goto out;
@@ -603,15 +604,14 @@ static ssize_t bonding_store_arp_targets(struct device *d,
603 return restart_syscall(); 604 return restart_syscall();
604 605
605 targets = bond->params.arp_targets; 606 targets = bond->params.arp_targets;
606 newtarget = in_aton(buf + 1); 607 if (!in4_pton(buf + 1, -1, (u8 *)&newtarget, -1, NULL) ||
608 IS_IP_TARGET_UNUSABLE_ADDRESS(newtarget)) {
609 pr_err("%s: invalid ARP target %pI4 specified for addition\n",
610 bond->dev->name, &newtarget);
611 goto out;
612 }
607 /* look for adds */ 613 /* look for adds */
608 if (buf[0] == '+') { 614 if (buf[0] == '+') {
609 if ((newtarget == 0) || (newtarget == htonl(INADDR_BROADCAST))) {
610 pr_err("%s: invalid ARP target %pI4 specified for addition\n",
611 bond->dev->name, &newtarget);
612 goto out;
613 }
614
615 if (bond_get_targets_ip(targets, newtarget) != -1) { /* dup */ 615 if (bond_get_targets_ip(targets, newtarget) != -1) { /* dup */
616 pr_err("%s: ARP target %pI4 is already present\n", 616 pr_err("%s: ARP target %pI4 is already present\n",
617 bond->dev->name, &newtarget); 617 bond->dev->name, &newtarget);
@@ -634,12 +634,6 @@ static ssize_t bonding_store_arp_targets(struct device *d,
634 targets[ind] = newtarget; 634 targets[ind] = newtarget;
635 write_unlock_bh(&bond->lock); 635 write_unlock_bh(&bond->lock);
636 } else if (buf[0] == '-') { 636 } else if (buf[0] == '-') {
637 if ((newtarget == 0) || (newtarget == htonl(INADDR_BROADCAST))) {
638 pr_err("%s: invalid ARP target %pI4 specified for removal\n",
639 bond->dev->name, &newtarget);
640 goto out;
641 }
642
643 ind = bond_get_targets_ip(targets, newtarget); 637 ind = bond_get_targets_ip(targets, newtarget);
644 if (ind == -1) { 638 if (ind == -1) {
645 pr_err("%s: unable to remove nonexistent ARP target %pI4.\n", 639 pr_err("%s: unable to remove nonexistent ARP target %pI4.\n",
@@ -701,6 +695,8 @@ static ssize_t bonding_store_downdelay(struct device *d,
701 int new_value, ret = count; 695 int new_value, ret = count;
702 struct bonding *bond = to_bond(d); 696 struct bonding *bond = to_bond(d);
703 697
698 if (!rtnl_trylock())
699 return restart_syscall();
704 if (!(bond->params.miimon)) { 700 if (!(bond->params.miimon)) {
705 pr_err("%s: Unable to set down delay as MII monitoring is disabled\n", 701 pr_err("%s: Unable to set down delay as MII monitoring is disabled\n",
706 bond->dev->name); 702 bond->dev->name);
@@ -734,6 +730,7 @@ static ssize_t bonding_store_downdelay(struct device *d,
734 } 730 }
735 731
736out: 732out:
733 rtnl_unlock();
737 return ret; 734 return ret;
738} 735}
739static DEVICE_ATTR(downdelay, S_IRUGO | S_IWUSR, 736static DEVICE_ATTR(downdelay, S_IRUGO | S_IWUSR,
@@ -756,6 +753,8 @@ static ssize_t bonding_store_updelay(struct device *d,
756 int new_value, ret = count; 753 int new_value, ret = count;
757 struct bonding *bond = to_bond(d); 754 struct bonding *bond = to_bond(d);
758 755
756 if (!rtnl_trylock())
757 return restart_syscall();
759 if (!(bond->params.miimon)) { 758 if (!(bond->params.miimon)) {
760 pr_err("%s: Unable to set up delay as MII monitoring is disabled\n", 759 pr_err("%s: Unable to set up delay as MII monitoring is disabled\n",
761 bond->dev->name); 760 bond->dev->name);
@@ -789,6 +788,7 @@ static ssize_t bonding_store_updelay(struct device *d,
789 } 788 }
790 789
791out: 790out:
791 rtnl_unlock();
792 return ret; 792 return ret;
793} 793}
794static DEVICE_ATTR(updelay, S_IRUGO | S_IWUSR, 794static DEVICE_ATTR(updelay, S_IRUGO | S_IWUSR,