]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
nicer comments
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 20 Nov 2008 09:48:36 +0000 (09:48 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 20 Nov 2008 09:48:36 +0000 (09:48 +0000)
git-svn-id: file:///svn/unbound/trunk@1366 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/unbound.c

index b051995bb7525eb484157ff8d54b5f678a41bd88..1a76fb2af97775e886a743c66d1edefa07c62419 100644 (file)
@@ -97,6 +97,7 @@ static void
 checkrlimits(struct config_file* cfg)
 {
 #ifdef HAVE_GETRLIMIT
+       /* list has number of ports to listen to, ifs number addresses */
        int list = ((cfg->do_udp?1:0) + (cfg->do_tcp?1 + 
                        (int)cfg->incoming_num_tcp:0));
        size_t listen_ifs = (size_t)(cfg->num_ifs==0?
@@ -133,6 +134,8 @@ checkrlimits(struct config_file* cfg)
                        log_warn("setrlimit: %s", strerror(errno));
                        log_warn("cannot increase max open fds from %u to %u",
                                (unsigned)avail, (unsigned)total+10);
+                       /* check that calculation below does not underflow,
+                        * with 15 as margin */
                        if(numthread*perthread_noudp+15 > avail)
                                fatal_exit("too much tcp. not enough fds.");
                        cfg->outgoing_num_ports = (int)((avail