Menu

#613 Add a possibility to listen only specified network interface

2.17.0
closed-fixed
5
2011-04-11
2010-10-25
Anton Pak
No

Seems it would be useful if we have such possibility.
For example it may be configured as OPENHPI_DEAMON_INTERFACES env variable.

I.e. OPENHPI_DEAMON_INTERFACES="lo,eth0"

Discussion

  • Anton Pak

    Anton Pak - 2010-12-07
    • milestone: 898633 --> 1365032
     
  • Anton Pak

    Anton Pak - 2011-04-11

    Seems there is no cross-platform way to listen only specific network
    interface.
    And there is no good platform-specific way too.

    On Linux:
    - It can be easily done with iptables. However it is out of OpenHPI scope.

    - There is setsockopt(SO_BINDTODEVICE). But it was described as deprecated
    and it requires root rights.

    I have examined several network services and found they used bind() call.
    They did convert interface name to interface address and called bind().
    Which is actually socket address binding but not the network interface
    binding.
    And the socket binded to the interface address stops working if the
    interface address is changed.
    For example DHCP server can change the interface address. And an User can
    do this too.
    NTPd developers introduced periodical check for interface address change.
    It can be good way.

     
  • Anton Pak

    Anton Pak - 2011-04-11

    After long distressful reflection I decided to take "bind address" road.
    So we have OPENHPI_DAEMON_BIND_ADDRESS env. var and -b (--bind) command line option.

    Implemented in trunk (rev. #7297)

     
  • Anton Pak

    Anton Pak - 2011-04-11
    • status: open --> closed-fixed
     
  • Anton Pak

    Anton Pak - 2011-04-11
    • milestone: 1365032 --> 2.17.0
     

Log in to post a comment.