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

Commit 3f6f255c authored by Amir Levy's avatar Amir Levy Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa4: fix endianity when checking vlan protocol



Check for vlan skb type was performed with wrong endianity.
Perform comparison with correct endianity.

Change-Id: Ifd8c04511cf2644e3a4881d956a86c3a1d242364
Signed-off-by: default avatarAmir Levy <alevy@codeaurora.org>
parent 85a10b57
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -619,8 +619,10 @@ static netdev_tx_t ecm_ipa_start_xmit
	}

	if (ecm_ipa_ctx->is_vlan_mode)
		if (unlikely(skb->protocol != ETH_P_8021Q))
			ECM_IPA_DEBUG("ether_type != ETH_P_8021Q && vlan\n");
		if (unlikely(skb->protocol != htons(ETH_P_8021Q)))
			ECM_IPA_DEBUG(
				"ether_type != ETH_P_8021Q && vlan, prot = 0x%X\n"
				, skb->protocol);

	ret = ipa_tx_dp(ecm_ipa_ctx->ipa_to_usb_client, skb, NULL);
	if (ret) {
+4 −2
Original line number Diff line number Diff line
@@ -2026,8 +2026,10 @@ static struct sk_buff *rndis_encapsulate_skb(struct sk_buff *skb,
	}

	if (rndis_ipa_ctx->is_vlan_mode)
		if (unlikely(skb->protocol != ETH_P_8021Q))
			RNDIS_IPA_DEBUG("ether_type != ETH_P_8021Q && vlan\n");
		if (unlikely(skb->protocol != htons(ETH_P_8021Q)))
			RNDIS_IPA_DEBUG(
				"ether_type != ETH_P_8021Q && vlan, prot = 0x%X\n"
				, skb->protocol);

	/* make room at the head of the SKB to put the RNDIS header */
	rndis_hdr = (struct rndis_pkt_hdr *)skb_push(skb,