Commit f76b57b4 authored by Joel A Fernandes's avatar Joel A Fernandes Committed by John W. Linville

mac80211: Fix mesh portal communication with other mesh nodes.

Fixed a bug where if a mesh interface has a different MAC address from its bridge
interface, then it would not be able to send data traffic to any other mesh node.
This also adds support for communication between mesh nodes and external bridged
nodes by using a 6 address format if the source is a node within the mesh and the
destination is an external node proxied by a mesh portal.
Signed-off-by: default avatarJoel A Fernandes <agnel.joel@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1c30cc19
...@@ -1747,6 +1747,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, ...@@ -1747,6 +1747,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
__le16 fc; __le16 fc;
struct ieee80211_hdr hdr; struct ieee80211_hdr hdr;
struct ieee80211s_hdr mesh_hdr __maybe_unused; struct ieee80211s_hdr mesh_hdr __maybe_unused;
struct mesh_path *mppath = NULL;
const u8 *encaps_data; const u8 *encaps_data;
int encaps_len, skip_header_bytes; int encaps_len, skip_header_bytes;
int nh_pos, h_pos; int nh_pos, h_pos;
...@@ -1807,16 +1808,23 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, ...@@ -1807,16 +1808,23 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
ret = NETDEV_TX_OK; ret = NETDEV_TX_OK;
goto fail; goto fail;
} }
if (!is_multicast_ether_addr(skb->data))
mppath = mpp_path_lookup(skb->data, sdata);
/*
* Do not use address extension, if it is a packet from
* the same interface and the destination is not being
* proxied by any other mest point.
*/
if (compare_ether_addr(sdata->vif.addr, if (compare_ether_addr(sdata->vif.addr,
skb->data + ETH_ALEN) == 0) { skb->data + ETH_ALEN) == 0 &&
(!mppath || !compare_ether_addr(mppath->mpp, skb->data))) {
hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc, hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc,
skb->data, skb->data + ETH_ALEN); skb->data, skb->data + ETH_ALEN);
meshhdrlen = ieee80211_new_mesh_header(&mesh_hdr, meshhdrlen = ieee80211_new_mesh_header(&mesh_hdr,
sdata, NULL, NULL); sdata, NULL, NULL);
} else { } else {
/* packet from other interface */ /* packet from other interface */
struct mesh_path *mppath;
int is_mesh_mcast = 1; int is_mesh_mcast = 1;
const u8 *mesh_da; const u8 *mesh_da;
...@@ -1827,8 +1835,6 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, ...@@ -1827,8 +1835,6 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
else { else {
static const u8 bcast[ETH_ALEN] = static const u8 bcast[ETH_ALEN] =
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
mppath = mpp_path_lookup(skb->data, sdata);
if (mppath) { if (mppath) {
/* RA TA mDA mSA AE:DA SA */ /* RA TA mDA mSA AE:DA SA */
mesh_da = mppath->mpp; mesh_da = mppath->mpp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment