diff options
Diffstat (limited to 'net/strparser/strparser.c')
-rw-r--r-- | net/strparser/strparser.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c index b9283ce5cd85..805b139756db 100644 --- a/net/strparser/strparser.c +++ b/net/strparser/strparser.c | |||
@@ -296,9 +296,9 @@ static int __strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb, | |||
296 | strp_start_timer(strp, timeo); | 296 | strp_start_timer(strp, timeo); |
297 | } | 297 | } |
298 | 298 | ||
299 | stm->accum_len += cand_len; | ||
299 | strp->need_bytes = stm->strp.full_len - | 300 | strp->need_bytes = stm->strp.full_len - |
300 | stm->accum_len; | 301 | stm->accum_len; |
301 | stm->accum_len += cand_len; | ||
302 | stm->early_eaten = cand_len; | 302 | stm->early_eaten = cand_len; |
303 | STRP_STATS_ADD(strp->stats.bytes, cand_len); | 303 | STRP_STATS_ADD(strp->stats.bytes, cand_len); |
304 | desc->count = 0; /* Stop reading socket */ | 304 | desc->count = 0; /* Stop reading socket */ |
@@ -321,6 +321,7 @@ static int __strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb, | |||
321 | /* Hurray, we have a new message! */ | 321 | /* Hurray, we have a new message! */ |
322 | cancel_delayed_work(&strp->msg_timer_work); | 322 | cancel_delayed_work(&strp->msg_timer_work); |
323 | strp->skb_head = NULL; | 323 | strp->skb_head = NULL; |
324 | strp->need_bytes = 0; | ||
324 | STRP_STATS_INCR(strp->stats.msgs); | 325 | STRP_STATS_INCR(strp->stats.msgs); |
325 | 326 | ||
326 | /* Give skb to upper layer */ | 327 | /* Give skb to upper layer */ |
@@ -410,9 +411,7 @@ void strp_data_ready(struct strparser *strp) | |||
410 | return; | 411 | return; |
411 | 412 | ||
412 | if (strp->need_bytes) { | 413 | if (strp->need_bytes) { |
413 | if (strp_peek_len(strp) >= strp->need_bytes) | 414 | if (strp_peek_len(strp) < strp->need_bytes) |
414 | strp->need_bytes = 0; | ||
415 | else | ||
416 | return; | 415 | return; |
417 | } | 416 | } |
418 | 417 | ||