mac80211: don't probe if we have probe response
[safe/jmp/linux-2.6] / net / mac80211 / mesh_pathtbl.c
index 2cebdf5..fbef678 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008 open80211s Ltd.
+ * Copyright (c) 2008, 2009 open80211s Ltd.
  * Author:     Luis Carlos Cobo <luisca@cozybit.com>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -260,7 +260,7 @@ int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata)
        int err = 0;
        u32 hash_idx;
 
-       if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0)
+       if (memcmp(dst, sdata->vif.addr, ETH_ALEN) == 0)
                /* never add ourselves as neighbours */
                return -ENOTSUPP;
 
@@ -377,7 +377,7 @@ int mpp_path_add(u8 *dst, u8 *mpp, struct ieee80211_sub_if_data *sdata)
        int err = 0;
        u32 hash_idx;
 
-       if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0)
+       if (memcmp(dst, sdata->vif.addr, ETH_ALEN) == 0)
                /* never add ourselves as neighbours */
                return -ENOTSUPP;
 
@@ -449,6 +449,7 @@ err_path_alloc:
  */
 void mesh_plink_broken(struct sta_info *sta)
 {
+       static const u8 bcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
        struct mesh_path *mpath;
        struct mpath_node *node;
        struct hlist_node *p;
@@ -467,8 +468,8 @@ void mesh_plink_broken(struct sta_info *sta)
                        spin_unlock_bh(&mpath->state_lock);
                        mesh_path_error_tx(MESH_TTL, mpath->dst,
                                        cpu_to_le32(mpath->sn),
-                                       PERR_RCODE_DEST_UNREACH,
-                                       sdata->dev->broadcast, sdata);
+                                       cpu_to_le16(PERR_RCODE_DEST_UNREACH),
+                                       bcast, sdata);
                } else
                spin_unlock_bh(&mpath->state_lock);
        }
@@ -604,7 +605,7 @@ void mesh_path_discard_frame(struct sk_buff *skb,
        struct mesh_path *mpath;
        u32 sn = 0;
 
-       if (memcmp(hdr->addr4, sdata->dev->dev_addr, ETH_ALEN) != 0) {
+       if (memcmp(hdr->addr4, sdata->vif.addr, ETH_ALEN) != 0) {
                u8 *ra, *da;
 
                da = hdr->addr3;
@@ -613,7 +614,7 @@ void mesh_path_discard_frame(struct sk_buff *skb,
                if (mpath)
                        sn = ++mpath->sn;
                mesh_path_error_tx(MESH_TTL, skb->data, cpu_to_le32(sn),
-                                  PERR_RCODE_NO_ROUTE, ra, sdata);
+                                  cpu_to_le16(PERR_RCODE_NO_ROUTE), ra, sdata);
        }
 
        kfree_skb(skb);