Search Linux Wireless

Re: [PATCH 07/13] o11s: support for mesh interfaces in mac80211 data path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +	if (rx->sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT) {
> +		if ((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) {
> +			if (!((rx->fc & IEEE80211_FCTL_FROMDS) &&
> +					(rx->fc & IEEE80211_FCTL_TODS)))

It'd be shorter to write

	if (rx->fc ^ (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS))

but I'm not sure that's easier to understand ;)

> +		/* If there is not an established peer link and this is
> +		 * not a peer link establisment frame, beacon or probe,
> +		 * drop the frame.
> +		 */
> +		if (!is_estab_plink(hdr->addr2, rx->dev)) {

This would get to be something like

		if (sta->flags & STA_FLAG_MESH_LINK_ESTABLISHED)

right?

> +			if ((rx->fc & IEEE80211_FCTL_FTYPE) !=
> +				IEEE80211_FTYPE_MGMT)
> +				return TXRX_DROP;

All this deep indentation is pretty ugly. Can you create a new function

static void rx_result ieee80211_rx_check_mesh(...)

and in ieee80211_rx_h_check() simply do

if (rx->sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT)
	return ieee80211_rx_check_mesh(...);

please?

> @@ -987,7 +1038,8 @@ ieee80211_rx_h_remove_qos_control(struct ieee80211_txrx_data *rx)
>  static int
>  ieee80211_802_1x_port_control(struct ieee80211_txrx_data *rx)
>  {
> -	if (unlikely(!rx->sta || !(rx->sta->flags & WLAN_STA_AUTHORIZED))) {
> +	if (rx->sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT &&
> +	    (!rx->sta || !(rx->sta->flags & WLAN_STA_AUTHORIZED))) {

I suppose you should be adding sta_info structs for each mesh peer and
set the AUTHORIZED flag on them. Is this what you were referring to in
the patch description?

> @@ -1222,6 +1290,36 @@ ieee80211_deliver_skb(struct ieee80211_txrx_data *rx)
>  		}
>  	}
>  
> +	/* Mesh forwarding */
> +	if (sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT) {

Similarly here, I think this code could benefit from the outdenting
achieved by putting it into an own function, the compiler will inline it
anyway. Also that could simplify #ifdef'ing the mesh code if we want
that.

> @@ -1474,9 +1508,10 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
>  	 * Drop unicast frames to unauthorised stations unless they are
>  	 * EAPOL frames from the local station.
>  	 */
> -	if (unlikely(!is_multicast_ether_addr(hdr.addr1) &&
> -		     !(sta_flags & WLAN_STA_AUTHORIZED) &&
> -		     !(ethertype == ETH_P_PAE &&
> +	if (sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT &&
> +	    (!is_multicast_ether_addr(hdr.addr1) &&
> +		      !(sta_flags & WLAN_STA_AUTHORIZED) &&
> +		      !(ethertype == ETH_P_PAE &&
>  		       compare_ether_addr(dev->dev_addr,
>  					  skb->data + ETH_ALEN) == 0))) {

That's also an artifact of not adding sta info structs, right?

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux