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

This commit is contained in:
Linux Build Service Account 2014-06-03 15:24:10 -07:00 committed by Gerrit - the friendly Code Review server
commit 3dda8f02d9
2 changed files with 8 additions and 0 deletions

View File

@ -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
};

View File

@ -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) {