]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blobdiff - openssh/patches/openssh-5.2p1-allow-ip-opts.patch
Move all packages to root.
[people/arne_f/ipfire-3.x.git] / openssh / patches / openssh-5.2p1-allow-ip-opts.patch
diff --git a/openssh/patches/openssh-5.2p1-allow-ip-opts.patch b/openssh/patches/openssh-5.2p1-allow-ip-opts.patch
new file mode 100644 (file)
index 0000000..96aaab1
--- /dev/null
@@ -0,0 +1,37 @@
+diff -up openssh-5.2p1/canohost.c.ip-opts openssh-5.2p1/canohost.c
+--- openssh-5.2p1/canohost.c.ip-opts   2009-02-14 06:28:21.000000000 +0100
++++ openssh-5.2p1/canohost.c   2009-09-01 15:31:29.000000000 +0200
+@@ -169,12 +169,27 @@ check_ip_options(int sock, char *ipaddr)
+       option_size = sizeof(options);
+       if (getsockopt(sock, ipproto, IP_OPTIONS, options,
+           &option_size) >= 0 && option_size != 0) {
+-              text[0] = '\0';
+-              for (i = 0; i < option_size; i++)
+-                      snprintf(text + i*3, sizeof(text) - i*3,
+-                          " %2.2x", options[i]);
+-              fatal("Connection from %.100s with IP options:%.800s",
+-                  ipaddr, text);
++              i = 0;
++              do {
++                      switch (options[i]) {
++                              case 0:
++                              case 1:
++                                      ++i;
++                                      break;
++                              case 131:
++                              case 137:
++                              /* Fail, fatally, if we detect either loose or strict
++                               * source routing options. */
++                                      text[0] = '\0';
++                                      for (i = 0; i < option_size; i++)
++                                              snprintf(text + i*3, sizeof(text) - i*3,
++                                                      " %2.2x", options[i]);
++                                      fatal("Connection from %.100s with IP options:%.800s",
++                                              ipaddr, text);
++                              default:
++                                      i += options[i + 1];
++                      }
++              } while (i < option_size);
+       }
+ #endif /* IP_OPTIONS */
+ }