summaryrefslogtreecommitdiffstats
path: root/net/strparser/strparser.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/strparser/strparser.c')
-rw-r--r--net/strparser/strparser.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c
index 373836615c57..625acb27efcc 100644
--- a/net/strparser/strparser.c
+++ b/net/strparser/strparser.c
@@ -35,7 +35,6 @@ struct _strp_msg {
35 */ 35 */
36 struct strp_msg strp; 36 struct strp_msg strp;
37 int accum_len; 37 int accum_len;
38 int early_eaten;
39}; 38};
40 39
41static inline struct _strp_msg *_strp_msg(struct sk_buff *skb) 40static inline struct _strp_msg *_strp_msg(struct sk_buff *skb)
@@ -115,20 +114,6 @@ static int __strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb,
115 head = strp->skb_head; 114 head = strp->skb_head;
116 if (head) { 115 if (head) {
117 /* Message already in progress */ 116 /* Message already in progress */
118
119 stm = _strp_msg(head);
120 if (unlikely(stm->early_eaten)) {
121 /* Already some number of bytes on the receive sock
122 * data saved in skb_head, just indicate they
123 * are consumed.
124 */
125 eaten = orig_len <= stm->early_eaten ?
126 orig_len : stm->early_eaten;
127 stm->early_eaten -= eaten;
128
129 return eaten;
130 }
131
132 if (unlikely(orig_offset)) { 117 if (unlikely(orig_offset)) {
133 /* Getting data with a non-zero offset when a message is 118 /* Getting data with a non-zero offset when a message is
134 * in progress is not expected. If it does happen, we 119 * in progress is not expected. If it does happen, we
@@ -297,9 +282,9 @@ static int __strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb,
297 } 282 }
298 283
299 stm->accum_len += cand_len; 284 stm->accum_len += cand_len;
285 eaten += cand_len;
300 strp->need_bytes = stm->strp.full_len - 286 strp->need_bytes = stm->strp.full_len -
301 stm->accum_len; 287 stm->accum_len;
302 stm->early_eaten = cand_len;
303 STRP_STATS_ADD(strp->stats.bytes, cand_len); 288 STRP_STATS_ADD(strp->stats.bytes, cand_len);
304 desc->count = 0; /* Stop reading socket */ 289 desc->count = 0; /* Stop reading socket */
305 break; 290 break;