* This gets called if the number of connections grows * past "max_connections". * * We kill the newest connection from a duplicate IP. */
| 844 | * We kill the newest connection from a duplicate IP. |
| 845 | */ |
| 846 | static void kill_some_child(void) |
| 847 | { |
| 848 | const struct child *blanket, *next; |
| 849 | |
| 850 | if (!(blanket = firstborn)) |
| 851 | return; |
| 852 | |
| 853 | for (; (next = blanket->next); blanket = next) |
| 854 | if (!addrcmp(&blanket->address, &next->address)) { |
| 855 | kill(blanket->cld.pid, SIGTERM); |
| 856 | break; |
| 857 | } |
| 858 | } |
| 859 | |
| 860 | static void check_dead_children(void) |
| 861 | { |