diff options
author | Thomas Pedersen <thomas@cozybit.com> | 2011-11-24 20:15:25 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-28 14:44:07 -0500 |
commit | 0cfda8519c85eb279166fb55a8553ee66eac9b35 (patch) | |
tree | 55f917c9402c0164a76c80b4675ea173562a869f /net/mac80211/mesh_pathtbl.c | |
parent | dca7e9430cb3e492437a5ce891b8b3e315c147ca (diff) |
mac80211: don't initiate path discovery when forwarding frame with unknown DA
We used to initiate a path discovery when receiving a frame for which
there is no forwarding information. To cut down on PREQ spam, just send
a (gated) PERR in response.
Also separate path discovery logic from nexthop querying. This patch
means we no longer queue frames when forwarding, so kill the PERR TX
stuff in discard_frame().
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mesh_pathtbl.c')
-rw-r--r-- | net/mac80211/mesh_pathtbl.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 4c50d8ade04f..edf167e3b8f3 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c | |||
@@ -973,38 +973,11 @@ int mesh_path_send_to_gates(struct mesh_path *mpath) | |||
973 | * @skb: frame to discard | 973 | * @skb: frame to discard |
974 | * @sdata: network subif the frame was to be sent through | 974 | * @sdata: network subif the frame was to be sent through |
975 | * | 975 | * |
976 | * If the frame was being forwarded from another MP, a PERR frame will be sent | ||
977 | * to the precursor. The precursor's address (i.e. the previous hop) was saved | ||
978 | * in addr1 of the frame-to-be-forwarded, and would only be overwritten once | ||
979 | * the destination is successfully resolved. | ||
980 | * | ||
981 | * Locking: the function must me called within a rcu_read_lock region | 976 | * Locking: the function must me called within a rcu_read_lock region |
982 | */ | 977 | */ |
983 | void mesh_path_discard_frame(struct sk_buff *skb, | 978 | void mesh_path_discard_frame(struct sk_buff *skb, |
984 | struct ieee80211_sub_if_data *sdata) | 979 | struct ieee80211_sub_if_data *sdata) |
985 | { | 980 | { |
986 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | ||
987 | struct mesh_path *mpath; | ||
988 | u32 sn = 0; | ||
989 | __le16 reason = cpu_to_le16(WLAN_REASON_MESH_PATH_NOFORWARD); | ||
990 | |||
991 | if (memcmp(hdr->addr4, sdata->vif.addr, ETH_ALEN) != 0) { | ||
992 | u8 *ra, *da; | ||
993 | |||
994 | da = hdr->addr3; | ||
995 | ra = hdr->addr2; | ||
996 | rcu_read_lock(); | ||
997 | mpath = mesh_path_lookup(da, sdata); | ||
998 | if (mpath) { | ||
999 | spin_lock_bh(&mpath->state_lock); | ||
1000 | sn = ++mpath->sn; | ||
1001 | spin_unlock_bh(&mpath->state_lock); | ||
1002 | } | ||
1003 | rcu_read_unlock(); | ||
1004 | mesh_path_error_tx(sdata->u.mesh.mshcfg.element_ttl, da, | ||
1005 | cpu_to_le32(sn), reason, ra, sdata); | ||
1006 | } | ||
1007 | |||
1008 | kfree_skb(skb); | 981 | kfree_skb(skb); |
1009 | sdata->u.mesh.mshstats.dropped_frames_no_route++; | 982 | sdata->u.mesh.mshstats.dropped_frames_no_route++; |
1010 | } | 983 | } |