diff options
author | Javier Cardona <javier@cozybit.com> | 2009-10-15 21:10:51 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:48:22 -0400 |
commit | 43b7b314f606b64f8645e4ec1a59df8a97a79b5a (patch) | |
tree | ff424a90e3b06b6cfd99d48e8a8b94a4aec8fa5d /net/mac80211/rx.c | |
parent | a9b3a9f7214b3acc56330c2257aeaa5fa85bf520 (diff) |
mac80211: Learn about mesh portals from multicast traffic
Mesh portals proxy traffic for nodes external to the mesh. When a
proxied frame is received by a mesh interface, it should update its mesh
portal table. This was only happening for unicast frames. With this
change we also learn about mesh portals from proxied multicast frames.
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r-- | net/mac80211/rx.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 7170bf4565a8..5c385e3c1d1f 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -1504,19 +1504,28 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) | |||
1504 | /* illegal frame */ | 1504 | /* illegal frame */ |
1505 | return RX_DROP_MONITOR; | 1505 | return RX_DROP_MONITOR; |
1506 | 1506 | ||
1507 | if (!is_multicast_ether_addr(hdr->addr1) && | 1507 | if (mesh_hdr->flags & MESH_FLAGS_AE) { |
1508 | (mesh_hdr->flags & MESH_FLAGS_AE_A5_A6)) { | ||
1509 | struct mesh_path *mppath; | 1508 | struct mesh_path *mppath; |
1509 | char *proxied_addr; | ||
1510 | char *mpp_addr; | ||
1511 | |||
1512 | if (is_multicast_ether_addr(hdr->addr1)) { | ||
1513 | mpp_addr = hdr->addr3; | ||
1514 | proxied_addr = mesh_hdr->eaddr1; | ||
1515 | } else { | ||
1516 | mpp_addr = hdr->addr4; | ||
1517 | proxied_addr = mesh_hdr->eaddr2; | ||
1518 | } | ||
1510 | 1519 | ||
1511 | rcu_read_lock(); | 1520 | rcu_read_lock(); |
1512 | mppath = mpp_path_lookup(mesh_hdr->eaddr2, sdata); | 1521 | mppath = mpp_path_lookup(proxied_addr, sdata); |
1513 | if (!mppath) { | 1522 | if (!mppath) { |
1514 | mpp_path_add(mesh_hdr->eaddr2, hdr->addr4, sdata); | 1523 | mpp_path_add(proxied_addr, mpp_addr, sdata); |
1515 | } else { | 1524 | } else { |
1516 | spin_lock_bh(&mppath->state_lock); | 1525 | spin_lock_bh(&mppath->state_lock); |
1517 | mppath->exp_time = jiffies; | 1526 | mppath->exp_time = jiffies; |
1518 | if (compare_ether_addr(mppath->mpp, hdr->addr4) != 0) | 1527 | if (compare_ether_addr(mppath->mpp, mpp_addr) != 0) |
1519 | memcpy(mppath->mpp, hdr->addr4, ETH_ALEN); | 1528 | memcpy(mppath->mpp, mpp_addr, ETH_ALEN); |
1520 | spin_unlock_bh(&mppath->state_lock); | 1529 | spin_unlock_bh(&mppath->state_lock); |
1521 | } | 1530 | } |
1522 | rcu_read_unlock(); | 1531 | rcu_read_unlock(); |