dhcpd on 127.0.0.1 is pointless ;)

Description

This mod (rev 8326) breaks DHCP! I tested this by backing it out of my
system and verifying that the problem went away. Here are the errors
from poller.log:

2008-02-04 09:12:04,999 DEBUG [PollerScheduler-30 Pool-fiber26] Poller:
Poller.ctor: opening socket connection with DHCP client daemon on port
5818
2008-02-04 09:12:05,001 ERROR [PollerScheduler-30 Pool-fiber26] Poller:
IO Exception during socket connection establishment with DHCP client
daemon.
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:208)
at org.opennms.netmgt.dhcpd.Poller.<init>(Poller.java:238)
at org.opennms.netmgt.dhcpd.Poller.isServer(Poller.java:401)
at org.opennms.netmgt.dhcpd.Dhcpd.isServer(Dhcpd.java:388)

Environment

Operating System: All Platform: All

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

DJ Gregor February 4, 2008 at 10:10 PM

Note that 127.0.0.1:5818 is for IPC between the OpenNMS DHCP daemon and the other OpenNMS daemons (particularly capsd and poller)--maybe it was originally that way so that dhcpd could be in a separate JVM, since it needs to bind to a privileged port. dhcpd still listens on the normal DHCP client port like a good little DHCP client.

Fixed in trunk revision 8340 by having the dhcp client in capsd/poller connect to InetAddress.getByName("127.0.0.1") instead of InetAddress.getLocalHost(). The latter would have ran into the issue in , as well, leading to silent (well, just logging ERRORs) failures.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

PagerDuty

Created February 4, 2008 at 3:22 PM
Updated January 27, 2017 at 4:25 PM
Resolved August 31, 2010 at 4:22 PM