On Thu, 30 Sep 1999, Ed G. wrote:

> The evidence:  I have watched sl0 using tcpdump and while 
> packets go out over the interface, no packets are ever sent back 
> over the proxy interface.  The source code provides a plausible 
> reason why this might be so:  it appears that diald downs the proxy 
> interface before it gets around to forwarding the packets, thus 
> guaranteeing the operation will fail! 

Which just goes to prove the value of comments that state
the *intentions* when complex interactions are going on :-).

  The problem is that we needed to actually down transient
interfaces but the code is shared by both the real link and
the proxy. As you noticed we should never down the proxy
because we need it to accept packets.

  The attached patch should work I think (I haven't tried
it myself). Anyone using an ifsetup script should ensure
that they are either using static addressing or use
"ip addr del ..." or "ifconfig x 0.0.0.0" to stop the proxy
rather than downing it.

  N.B. on non-AF_PACKET kernels such as 2.0.x this sets the
proxy to 127.0.0.2 because 0.0.0.0 may have special meaning
on some interface types. This may or may not be a problem
in some cases, I haven't thought about it too much.

Index: route.c
===================================================================
RCS file: /u/CVS/diald/route.c,v
retrieving revision 1.22
diff -u -u -r1.22 route.c
--- route.c     1999/06/01 22:49:55     1.22
+++ route.c     1999/10/01 17:15:19
@@ -199,12 +199,22 @@
      */
     del_routes(desc, iface, lip, rip);
 
-    sprintf(buf, "%s %s %s",
-       path_ifconfig, iface,
+    if (strcmp(mode, "proxy") == 0) {
+       sprintf(buf, "%s %s %s",
+           path_ifconfig, iface,
 #ifdef HAVE_AF_PACKET
-       (af_packet && current_mode == MODE_DEV) ? "0.0.0.0" : "down");
+           af_packet ? "0.0.0.0" : "127.0.0.2");
 #else
-       current_mode == MODE_DEV ? "0.0.0.0" : "down");
+           "127.0.0.2");
 #endif
+    } else {
+       sprintf(buf, "%s %s %s",
+           path_ifconfig, iface,
+#ifdef HAVE_AF_PACKET
+           (af_packet && current_mode == MODE_DEV) ? "0.0.0.0" : "down");
+#else
+           current_mode == MODE_DEV ? "0.0.0.0" : "down");
+#endif
+    }
     run_shell(SHELL_WAIT, desc, buf, -1);
 }


-- 
.----------------------------------------------------------------------.
| Mike Jagdis                   | Internet: [EMAIL PROTECTED]  |
| 280, Silverdale Road, Earley, | Voice:    +44 118 926 6996           |
| Reading RG6 7NU ENGLAND       | Work:     +44 118 989 0403           |
`----------------------------------------------------------------------'


-
To unsubscribe from this list: send the line "unsubscribe linux-diald" in
the body of a message to [EMAIL PROTECTED]

Reply via email to