debian-416404_out-of-order-sequence-number.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. Description: Check for out-of-order sequence numbers
  2. Applied upstream 2007-04-24 05:13:17
  3. Origin: http://marc.info/?l=poptop-server&m=117737453400588&w=2
  4. Forwarded: not-needed
  5. Bug-Debian: http://bugs.debian.org/416404
  6. --- a/pptpgre.c
  7. +++ b/pptpgre.c
  8. @@ -403,15 +403,20 @@
  9. stats.rx_truncated++;
  10. return 0;
  11. }
  12. - /* check for out-of-order sequence number */
  13. - if (seq == gre.seq_recv + 1) {
  14. + /* check for out-of-order sequence number
  15. + * N.B.: some client implementations violate RFC 2637
  16. + * and start their sequence numbers at 1 instead of 0,
  17. + * so we have to introduce a kludge to deal with it.
  18. + * on wrap we may allow an out of order packet to pass
  19. + */
  20. + if (seq == gre.seq_recv + 1 || seq == 1) {
  21. if (pptpctrl_debug)
  22. syslog(LOG_DEBUG, "GRE: accepting packet #%d",
  23. seq);
  24. stats.rx_accepted++;
  25. gre.seq_recv = seq;
  26. return cb(cl, buffer + ip_len + headersize, payload_len);
  27. - } else if (seq == gre.seq_recv) {
  28. + } else if (!seq_greater(seq, gre.seq_recv)) {
  29. if (pptpctrl_debug)
  30. syslog(LOG_DEBUG,
  31. "GRE: discarding duplicate or old packet #%d (expecting #%d)",