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

Commit 56712624 authored by Lakshit Tyagi's avatar Lakshit Tyagi Committed by Gerrit - the friendly Code Review server
Browse files

data-kernel: emac: Resolving EMAC crash



 - resolve EMAC crash caused due improper ip header handling

Change-Id: Ia9d4249592a2a0dcfa492cd07dcf25fdf62f70e7
Signed-off-by: default avatarLakshit Tyagi <ltyagi@codeaurora.org>
parent e0ec164b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2429,6 +2429,7 @@ inline UINT DWC_ETH_QOS_cal_int_mod(struct sk_buff *skb, UINT eth_type,
	struct DWC_ETH_QOS_prv_data *pdata)
{
	UINT ret = DEFAULT_INT_MOD;
	bool is_udp;

#ifdef DWC_ETH_QOS_CONFIG_PTP
	if (eth_type == ETH_P_1588)
@@ -2439,8 +2440,11 @@ inline UINT DWC_ETH_QOS_cal_int_mod(struct sk_buff *skb, UINT eth_type,
		ret = AVB_INT_MOD;
	} else if (eth_type == ETH_P_IP || eth_type == ETH_P_IPV6) {
#ifdef DWC_ETH_QOS_CONFIG_PTP
		if (udp_hdr(skb)->dest == htons(PTP_UDP_EV_PORT)
			|| udp_hdr(skb)->dest == htons(PTP_UDP_GEN_PORT)) {
		is_udp = (eth_type == ETH_P_IP && ip_hdr(skb)->protocol == IPPROTO_UDP)
						|| (eth_type == ETH_P_IPV6 && ipv6_hdr(skb)->nexthdr == IPPROTO_UDP);

		if (is_udp && (udp_hdr(skb)->dest == htons(PTP_UDP_EV_PORT)
			|| udp_hdr(skb)->dest == htons(PTP_UDP_GEN_PORT))) {
			ret = PTP_INT_MOD;
		} else
#endif