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: Harout Hedeshian <harouth@codeaurora.org>
This commit is contained in:
parent
e9f3f57cb4
commit
7bca9efc31
2 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
};
|
||||
|
||||
|
|
|
@ -126,6 +126,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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue