[or-cvs] Omit any exit rules that follow a catch-all rule when writi...

Nick Mathewson nickm at seul.org
Wed Oct 13 01:25:44 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv29163/src/or

Modified Files:
	router.c 
Log Message:
Omit any exit rules that follow a catch-all rule when writing a router descriptor.

Index: router.c
===================================================================
RCS file: /home/or/cvsroot/src/or/router.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- router.c	7 Oct 2004 20:22:58 -0000	1.91
+++ router.c	13 Oct 2004 01:25:42 -0000	1.92
@@ -709,7 +709,7 @@
         return -1;
       written += result;
     }
-    if (tmpe->prt_min == 0 && tmpe->prt_max == 65535) {
+    if (tmpe->prt_min <= 1 && tmpe->prt_max == 65535) {
       /* There is no port set; write ":*" */
       if (written > maxlen-4)
         return -1;
@@ -729,6 +729,9 @@
         return -1;
       written += result;
     }
+    if (tmpe->msk == 0 && tmpe->prt_min <= 1 && tmpe->prt_max == 65535)
+      /* This was a catch-all rule, so future rules are irrelevant. */
+      break;
   } /* end for */
   if (written > maxlen-256) /* Not enough room for signature. */
     return -1;



More information about the tor-commits mailing list