#127 Multiple listen-address implementation

closed-accepted
Fabian Keil
5
2011-07-17
2011-07-05
Petr Písař
No

Hello,

I found some operating systems does not allow to accept IPv4 client on IPv6 sockets or some system are configured in such manner (like GNU/Debian). Also I think it can be helpful to bind Privoxy to certain addresses only or to more ports.

There is similar item #71 on TODO list. My implementation forces to bind to all listed addresses. However it could be possible to adjust it.

I performed only few tests so there can be some bugs.

I will attach series of 5 patches against latest CVS tree.

Discussion

1 2 > >> (Page 1 of 2)
  • Fabian Keil
    Fabian Keil
    2011-07-06

    Thanks a lot for the patches.

    I'll have a closer look at them this weekend.

     
  • Fabian Keil
    Fabian Keil
    2011-07-06

    • assigned_to: nobody --> fabiankeil
    • status: open --> pending
     
  • Fabian Keil
    Fabian Keil
    2011-07-10

    I think there may be a logical error in bind_ports_helper().

    + if (JB_INVALID_SOCKET == sockets[i])
    + {
    + config->need_bind = 0;
    + }

    Shouldn't the condition be JB_INVALID_SOCKET != sockets[i] here?

     
  • Petr Písař
    Petr Písař
    2011-07-11

    You are right. Current code does not make sense. Correct fix depends on semantics you want to give to bind_ports_helper():

    (1) If you want to drop not-bound sockets and survive with successfully opened ones, your suggestion is correct.

    (2) If you want to leave possibility to re-bound on next loop cycle, one should pre-set config->need_bind to 0, keep the condition and change conditional assignment to setting 1.

    The only drawback is current bind_port_helper(), that's called from bind_ports_helper(), dies on any error, thus resolving given problem is just an academic question.

    I think choosing solution (2) opens way for implementing TODO item #71 more comprehensively. So I vote for it. Actually current implementation dies on reloading wrong configuration which I don't like. I think the daemon, once started, should keep running as long as possible.

     
1 2 > >> (Page 1 of 2)