aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mesh_pathtbl.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/mesh_pathtbl.c')
-rw-r--r--net/mac80211/mesh_pathtbl.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index 751c4d0e2b36..a8da23905c70 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2008 open80211s Ltd. 2 * Copyright (c) 2008, 2009 open80211s Ltd.
3 * Author: Luis Carlos Cobo <luisca@cozybit.com> 3 * Author: Luis Carlos Cobo <luisca@cozybit.com>
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
@@ -449,6 +449,7 @@ err_path_alloc:
449 */ 449 */
450void mesh_plink_broken(struct sta_info *sta) 450void mesh_plink_broken(struct sta_info *sta)
451{ 451{
452 static const u8 bcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
452 struct mesh_path *mpath; 453 struct mesh_path *mpath;
453 struct mpath_node *node; 454 struct mpath_node *node;
454 struct hlist_node *p; 455 struct hlist_node *p;
@@ -463,11 +464,12 @@ void mesh_plink_broken(struct sta_info *sta)
463 mpath->flags & MESH_PATH_ACTIVE && 464 mpath->flags & MESH_PATH_ACTIVE &&
464 !(mpath->flags & MESH_PATH_FIXED)) { 465 !(mpath->flags & MESH_PATH_FIXED)) {
465 mpath->flags &= ~MESH_PATH_ACTIVE; 466 mpath->flags &= ~MESH_PATH_ACTIVE;
466 ++mpath->dsn; 467 ++mpath->sn;
467 spin_unlock_bh(&mpath->state_lock); 468 spin_unlock_bh(&mpath->state_lock);
468 mesh_path_error_tx(mpath->dst, 469 mesh_path_error_tx(MESH_TTL, mpath->dst,
469 cpu_to_le32(mpath->dsn), 470 cpu_to_le32(mpath->sn),
470 sdata->dev->broadcast, sdata); 471 cpu_to_le16(PERR_RCODE_DEST_UNREACH),
472 bcast, sdata);
471 } else 473 } else
472 spin_unlock_bh(&mpath->state_lock); 474 spin_unlock_bh(&mpath->state_lock);
473 } 475 }
@@ -601,7 +603,7 @@ void mesh_path_discard_frame(struct sk_buff *skb,
601{ 603{
602 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 604 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
603 struct mesh_path *mpath; 605 struct mesh_path *mpath;
604 u32 dsn = 0; 606 u32 sn = 0;
605 607
606 if (memcmp(hdr->addr4, sdata->dev->dev_addr, ETH_ALEN) != 0) { 608 if (memcmp(hdr->addr4, sdata->dev->dev_addr, ETH_ALEN) != 0) {
607 u8 *ra, *da; 609 u8 *ra, *da;
@@ -610,8 +612,9 @@ void mesh_path_discard_frame(struct sk_buff *skb,
610 ra = hdr->addr1; 612 ra = hdr->addr1;
611 mpath = mesh_path_lookup(da, sdata); 613 mpath = mesh_path_lookup(da, sdata);
612 if (mpath) 614 if (mpath)
613 dsn = ++mpath->dsn; 615 sn = ++mpath->sn;
614 mesh_path_error_tx(skb->data, cpu_to_le32(dsn), ra, sdata); 616 mesh_path_error_tx(MESH_TTL, skb->data, cpu_to_le32(sn),
617 cpu_to_le16(PERR_RCODE_NO_ROUTE), ra, sdata);
615 } 618 }
616 619
617 kfree_skb(skb); 620 kfree_skb(skb);
@@ -646,7 +649,7 @@ void mesh_path_fix_nexthop(struct mesh_path *mpath, struct sta_info *next_hop)
646{ 649{
647 spin_lock_bh(&mpath->state_lock); 650 spin_lock_bh(&mpath->state_lock);
648 mesh_path_assign_nexthop(mpath, next_hop); 651 mesh_path_assign_nexthop(mpath, next_hop);
649 mpath->dsn = 0xffff; 652 mpath->sn = 0xffff;
650 mpath->metric = 0; 653 mpath->metric = 0;
651 mpath->hop_count = 0; 654 mpath->hop_count = 0;
652 mpath->exp_time = 0; 655 mpath->exp_time = 0;