summaryrefslogtreecommitdiff
path: root/net/rmnet_data
diff options
context:
space:
mode:
authorHarout Hedeshian <harouth@codeaurora.org>2014-04-30 09:50:43 -0600
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:05:15 -0700
commit7bca9efc313321ecdf7c50a618cf2364e812b5c4 (patch)
tree481288ead5dc4201aee337a37d03a05645cd2130 /net/rmnet_data
parente9f3f57cb444973303de263a805f826625cf1808 (diff)
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>
Diffstat (limited to 'net/rmnet_data')
-rw-r--r--net/rmnet_data/rmnet_data_stats.h1
-rw-r--r--net/rmnet_data/rmnet_map_data.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/net/rmnet_data/rmnet_data_stats.h b/net/rmnet_data/rmnet_data_stats.h
index 6b5ec1f84c35..7a64f998f068 100644
--- a/net/rmnet_data/rmnet_data_stats.h
+++ b/net/rmnet_data/rmnet_data_stats.h
@@ -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
};
diff --git a/net/rmnet_data/rmnet_map_data.c b/net/rmnet_data/rmnet_map_data.c
index 4a7f7a3a3d98..655762b0cec0 100644
--- a/net/rmnet_data/rmnet_map_data.c
+++ b/net/rmnet_data/rmnet_map_data.c
@@ -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) {