aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2014-10-01 08:59:15 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2014-10-02 06:41:57 -0400
commit9c238ca8ec79c38ab22762b44aeaf7a42fc97b18 (patch)
treec53ad8a1e084b78205150e5401e44ad8295f06d2 /net
parentd7b6b0a532da7de25e16deed610658cfa1969fe9 (diff)
Bluetooth: 6lowpan: Check transmit errors for multicast packets
We did not return error if multicast packet transmit failed. This might not be desired so return error also in this case. If there are multiple 6lowpan devices where the multicast packet is sent, then return error even if sending to only one of them fails. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/6lowpan.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index fcfaa7006b28..c2e0d14433df 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -546,11 +546,12 @@ static int send_pkt(struct l2cap_chan *chan, struct sk_buff *skb,
546 return err; 546 return err;
547} 547}
548 548
549static void send_mcast_pkt(struct sk_buff *skb, struct net_device *netdev) 549static int send_mcast_pkt(struct sk_buff *skb, struct net_device *netdev)
550{ 550{
551 struct sk_buff *local_skb; 551 struct sk_buff *local_skb;
552 struct lowpan_dev *entry, *tmp; 552 struct lowpan_dev *entry, *tmp;
553 unsigned long flags; 553 unsigned long flags;
554 int err = 0;
554 555
555 read_lock_irqsave(&devices_lock, flags); 556 read_lock_irqsave(&devices_lock, flags);
556 557
@@ -564,19 +565,25 @@ static void send_mcast_pkt(struct sk_buff *skb, struct net_device *netdev)
564 dev = lowpan_dev(entry->netdev); 565 dev = lowpan_dev(entry->netdev);
565 566
566 list_for_each_entry_safe(pentry, ptmp, &dev->peers, list) { 567 list_for_each_entry_safe(pentry, ptmp, &dev->peers, list) {
568 int ret;
569
567 local_skb = skb_clone(skb, GFP_ATOMIC); 570 local_skb = skb_clone(skb, GFP_ATOMIC);
568 571
569 BT_DBG("xmit %s to %pMR type %d IP %pI6c chan %p", 572 BT_DBG("xmit %s to %pMR type %d IP %pI6c chan %p",
570 netdev->name, 573 netdev->name,
571 &pentry->chan->dst, pentry->chan->dst_type, 574 &pentry->chan->dst, pentry->chan->dst_type,
572 &pentry->peer_addr, pentry->chan); 575 &pentry->peer_addr, pentry->chan);
573 send_pkt(pentry->chan, local_skb, netdev); 576 ret = send_pkt(pentry->chan, local_skb, netdev);
577 if (ret < 0)
578 err = ret;
574 579
575 kfree_skb(local_skb); 580 kfree_skb(local_skb);
576 } 581 }
577 } 582 }
578 583
579 read_unlock_irqrestore(&devices_lock, flags); 584 read_unlock_irqrestore(&devices_lock, flags);
585
586 return err;
580} 587}
581 588
582static netdev_tx_t bt_xmit(struct sk_buff *skb, struct net_device *netdev) 589static netdev_tx_t bt_xmit(struct sk_buff *skb, struct net_device *netdev)
@@ -620,7 +627,7 @@ static netdev_tx_t bt_xmit(struct sk_buff *skb, struct net_device *netdev)
620 /* We need to send the packet to every device behind this 627 /* We need to send the packet to every device behind this
621 * interface. 628 * interface.
622 */ 629 */
623 send_mcast_pkt(skb, netdev); 630 err = send_mcast_pkt(skb, netdev);
624 } 631 }
625 632
626 dev_kfree_skb(skb); 633 dev_kfree_skb(skb);