httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colm MacCarthaigh <c...@stdlib.net>
Subject Re: cvs commit: httpd-2.0/server listen.c
Date Mon, 25 Aug 2003 23:22:32 GMT
On Mon, Aug 25, 2003 at 06:32:08PM +0100, Joe Orton wrote:
> I committed a patch (different to the one I posted) which passes the
> right thing to the IN6_blah macro, so it should compile still on Darwin.
> Ta!

To further illustrate how silly it was of me to write a patch at
4am on Sunday morning it actually needs one more change.

Setting lr to NULL causes a seg-fault if the port was already 
in use, and didnt do what it was intended to anyway since the
for loop terminates on lr == NULL.


Index: server/listen.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/listen.c,v
retrieving revision 1.91
diff -u -r1.91 listen.c
--- server/listen.c	25 Aug 2003 16:00:49 -0000	1.91
+++ server/listen.c	25 Aug 2003 23:18:54 -0000
@@ -395,8 +395,13 @@
                         ap_listeners = lr->next;
                     }
 
-                    /* So that previous becomes NULL in the next iteration */
-                    lr = NULL;
+		    /* Allthough we've removed ourselves from the list, 
+                     * we need to make sure that the next iteration won't
+                     * consider "previous" a working IPv6 '::' socket. 
+                     * Changing the family is enough to make sure the
+                     * conditions before make_sock() fail. 
+                     */
+                    lr->bind_addr->family = AF_INET;
 
                     continue;
                 }

-- 
Colm MacCárthaigh                        Public Key: colm+pgp@stdlib.net
colm@stdlib.net					  http://www.stdlib.net/

Mime
View raw message