Hi again,

Axel Beckert wrote:
> While the if-case in line 129 seems logical for me, the flags variable
> always contains 0 despite it contains non-zero values in
> /proc/net/route. If I comment out line 132 ("(flags & 0x0001) && //
> route is UP"), it seems to select the right route, but I always end up
> with the message "ACK not seen so RST not sent (sorry!)".

I've risen the amount of time to wait for an ACK to 80 seconds and now
it seems to always work on the bridging computer and sometimes work on
the end point computer. Now I can at least debug the reconnect feature
of my IRC bot.

Attached the patch with which I came that far. It's though very likely
not yet complete to solve all the related issues. (Hence no tag
"patch".)

                Regards, Axel
-- 
 ,''`.  |  Axel Beckert <a...@debian.org>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE
  `-    |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
diff -u cutter-1.03/cutter.c cutter-1.03/cutter.c
--- cutter-1.03/cutter.c
+++ cutter-1.03/cutter.c
@@ -128,7 +128,7 @@
                        mask = mask;
                        if (
                                iface[0] != '*' &&              // not a 
rejected interface
-                               (flags & 0x0001) &&             // route is UP
+                               //(flags & 0x0001) &&           // route is UP
                                (flags & 0x0200) == 0 &&        // not a 
"reject"
                                (ip & mask) == dest_ip          // IP match
                        ) {
@@ -375,7 +375,7 @@
 
        tstart = time(0);
 
-       for ( ; time(0) < tstart + 15; ) {      // give the peer 15 seconds to 
respond
+       for ( ; time(0) < tstart + 80; ) {      // give the peer 80 seconds to 
respond
                struct sockaddr_ll gotaddr;
                unsigned int addrlen = sizeof(gotaddr);
                fd_set readfds;
@@ -534,6 +534,26 @@
                                found ++;
                                printf("For connection %s:%d -> %s:%d\n", dst2, 
dport2, src2, sport2);
                                ok = send_rst(dst1,dport1,src1,sport1) && ok;
+                               ok = send_rst(dst2,dport2,src2,sport2) && ok;
+                       }
+
+                       /* Outbound connection from private network device */
+
+                       else if (localip(src1n) && !localip(dst1n) && 
!localip(src2n) && localip(dst2n)) {
+puts("Outbound connection from private network device");
+                               found ++;
+                               printf("For connection %s:%d -> %s:%d\n", dst2, 
dport2, src2, sport2);
+                               ok = send_rst(dst1,dport1,src1,sport1) && ok;
+                               ok = send_rst(dst2,dport2,src2,sport2) && ok;
+                       }
+
+                       /* Connection going through */
+
+                       else if (!localip(src1n) && !localip(dst1n) && 
!localip(src2n) && !localip(dst2n)) {
+puts("Connection going through");
+                               found ++;
+                               printf("For connection %s:%d -> %s:%d\n", dst2, 
dport2, src2, sport2);
+                               ok = send_rst(dst1,dport1,src1,sport1) && ok;
                                ok = send_rst(dst2,dport2,src2,sport2) && ok;
                        }
                }
diff -u cutter-1.03/debian/changelog cutter-1.03/debian/changelog
--- cutter-1.03/debian/changelog
+++ cutter-1.03/debian/changelog
@@ -1,3 +1,9 @@
+cutter (1.03-2.1~test1) unstable; urgency=low
+
+  * Test patch for #446343
+
+ -- Axel Beckert <a...@debian.org>  Thu, 27 Dec 2012 00:24:43 +0100
+
 cutter (1.03-2) unstable; urgency=low
 
   * Adopt the package (Closes: #316195).

Reply via email to