OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
2.2 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../pptpd/pptpd-1.3.4-pptpgre-out-of-order-sequence-number.patch
  5. # Copyright (C) 2011 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. From b99f5370362fe266b10dd195120c23e2bf64286f Mon Sep 17 00:00:00 2001
  17. From: Christian Wiese <christian.wiese@securepoint.de>
  18. Date: Wed, 24 Aug 2011 13:53:45 +0200
  19. Subject: [PATCH] pptpgre: added check for out-of-order sequence number
  20. Origin: http://marc.info/?l=poptop-server&m=117737453400588&w=2
  21. Debian Bugs: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=416404
  22. ---
  23. pptpgre.c | 11 ++++++++---
  24. 1 files changed, 8 insertions(+), 3 deletions(-)
  25. diff --git pptpd-1.3.4.orig/pptpgre.c 1.3.4/pptpgre.c
  26. index 9efabae..d84ea9b 100644
  27. --- pptpd-1.3.4.orig/pptpgre.c
  28. +++ 1.3.4/pptpgre.c
  29. @@ -403,15 +403,20 @@ int decaps_gre(int fd, int (*cb) (int cl, void *pack, unsigned len), int cl)
  30. stats.rx_truncated++;
  31. return 0;
  32. }
  33. - /* check for out-of-order sequence number */
  34. - if (seq == gre.seq_recv + 1) {
  35. + /* check for out-of-order sequence number
  36. + * N.B.: some client implementations violate RFC 2637
  37. + * and start their sequence numbers at 1 instead of 0,
  38. + * so we have to introduce a kludge to deal with it.
  39. + * on wrap we may allow an out of order packet to pass
  40. + */
  41. + if (seq == gre.seq_recv + 1 || seq == 1) {
  42. if (pptpctrl_debug)
  43. syslog(LOG_DEBUG, "GRE: accepting packet #%d",
  44. seq);
  45. stats.rx_accepted++;
  46. gre.seq_recv = seq;
  47. return cb(cl, buffer + ip_len + headersize, payload_len);
  48. - } else if (seq == gre.seq_recv) {
  49. + } else if (!seq_greater(seq, gre.seq_recv)) {
  50. if (pptpctrl_debug)
  51. syslog(LOG_DEBUG,
  52. "GRE: discarding duplicate or old packet #%d (expecting #%d)",
  53. --
  54. 1.6.6.2