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

Commit fcb888fb authored by Harout Hedeshian's avatar Harout Hedeshian
Browse files

net: rmnet_data: Catch empty MAP frames during de-aggregation



RmNet Data does not explicitly catch 0-length MAP frames when
de-aggregating frames. This causes the empty MAP frames to get dropped
at a later point in MAP processing, causing the drop counters to get
skewed with benign drops. This patch explicitly handles 0-length
MAP frames and adds a dedicated drop counter. This change is required
on hardware which generates 0-length MAP frames.

CRs-Fixed: 673296
Change-Id: I8e7210403d35018bffa8f45ea1b4b5752f3e30be
Signed-off-by: default avatarHarout Hedeshian <harouth@codeaurora.org>
parent 9e91c0c5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ enum rmnet_skb_free_e {
	RMNET_STATS_SKBFREE_DEAGG_MALFORMED,
	RMNET_STATS_SKBFREE_DEAGG_CLONE_FAIL,
	RMNET_STATS_SKBFREE_DEAGG_UNKOWN_IP_TYP,
	RMNET_STATS_SKBFREE_DEAGG_DATA_LEN_0,
	RMNET_STATS_SKBFREE_MAX
};

+7 −0
Original line number Diff line number Diff line
@@ -125,6 +125,13 @@ struct sk_buff *rmnet_map_deaggregate(struct sk_buff *skb,
	skb_pull(skb, packet_len);
	LOGD("after skbn->len = %d", skbn->len);

	/* Some hardware can send us empty frames. Catch them */
	if (ntohs(maph->pkt_len) == 0) {
		LOGD("Dropping empty MAP frame");
		rmnet_kfree_skb(skbn, RMNET_STATS_SKBFREE_DEAGG_DATA_LEN_0);
		return 0;
	}

	/* Sanity check */
	ip_byte = (skbn->data[4]) & 0xF0;
	if (ip_byte != 0x40 && ip_byte != 0x60) {