Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a621fa4d authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

mac80211: allow changing port control protocol



Some vendor specified mechanisms for 802.1X-style
functionality use a different protocol than EAP
(even if EAP is vendor-extensible). Support this
in mac80211 via the cfg80211 API for it.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJuuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent c0692b8f
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -509,6 +509,8 @@ struct ieee80211_sub_if_data {
	struct ieee80211_key *default_mgmt_key;
	struct ieee80211_key *default_mgmt_key;


	u16 sequence_number;
	u16 sequence_number;
	__be16 control_port_protocol;
	bool control_port_no_encrypt;


	struct work_struct work;
	struct work_struct work;
	struct sk_buff_head skb_queue;
	struct sk_buff_head skb_queue;
+3 −0
Original line number Original line Diff line number Diff line
@@ -855,6 +855,9 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata,
	sdata->dev->netdev_ops = &ieee80211_dataif_ops;
	sdata->dev->netdev_ops = &ieee80211_dataif_ops;
	sdata->wdev.iftype = type;
	sdata->wdev.iftype = type;


	sdata->control_port_protocol = cpu_to_be16(ETH_P_PAE);
	sdata->control_port_no_encrypt = false;

	/* only monitor differs */
	/* only monitor differs */
	sdata->dev->type = ARPHRD_ETHER;
	sdata->dev->type = ARPHRD_ETHER;


+3 −0
Original line number Original line Diff line number Diff line
@@ -627,6 +627,9 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
	local->hw.wiphy->interface_modes &= ~BIT(NL80211_IFTYPE_MESH_POINT);
	local->hw.wiphy->interface_modes &= ~BIT(NL80211_IFTYPE_MESH_POINT);
#endif
#endif


	/* mac80211 supports control port protocol changing */
	local->hw.wiphy->flags |= WIPHY_FLAG_CONTROL_PORT_PROTOCOL;

	if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM)
	if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM)
		local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
		local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
	else if (local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)
	else if (local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)
+3 −0
Original line number Original line Diff line number Diff line
@@ -2262,6 +2262,9 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
	else
	else
		ifmgd->flags &= ~IEEE80211_STA_CONTROL_PORT;
		ifmgd->flags &= ~IEEE80211_STA_CONTROL_PORT;


	sdata->control_port_protocol = req->crypto.control_port_ethertype;
	sdata->control_port_no_encrypt = req->crypto.control_port_no_encrypt;

	ieee80211_add_work(wk);
	ieee80211_add_work(wk);
	return 0;
	return 0;
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -1527,7 +1527,7 @@ static bool ieee80211_frame_allowed(struct ieee80211_rx_data *rx, __le16 fc)
	 * Allow EAPOL frames to us/the PAE group address regardless
	 * Allow EAPOL frames to us/the PAE group address regardless
	 * of whether the frame was encrypted or not.
	 * of whether the frame was encrypted or not.
	 */
	 */
	if (ehdr->h_proto == htons(ETH_P_PAE) &&
	if (ehdr->h_proto == rx->sdata->control_port_protocol &&
	    (compare_ether_addr(ehdr->h_dest, rx->sdata->vif.addr) == 0 ||
	    (compare_ether_addr(ehdr->h_dest, rx->sdata->vif.addr) == 0 ||
	     compare_ether_addr(ehdr->h_dest, pae_group_addr) == 0))
	     compare_ether_addr(ehdr->h_dest, pae_group_addr) == 0))
		return true;
		return true;
Loading