Project

General

Profile

Bug #7042

DHCP client configures wrong address in some circumstances (setfirst support missing from ifconfig)

Added by Jim Pingle 9 months ago. Updated 8 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Interfaces
Target version:
Start date:
12/27/2016
Due date:
% Done:

100%

Affected version:
2.4
Affected Architecture:
All

Description

In certain circumstances a DHCP client interface gets configured with an incorrect address. The address that should be the interface address is found to be the broadcast address, and the interface address appears to be bogus along with the subnet mask.


We now know this is the result of the "setfirst" patch being removed. The /usr/local/sbin/pfSense-dhclient-script attempts to execute this line:

$IFCONFIG $interface setfirst $new_ip_address

Without the "setfirst" patch, that is taken as a hostname, which the client then attempts to resolve via DNS

If the upstream DNS does not properly return NXDOMAIN results, the bogus result is used for the interface IP address and the interface's real address becomes the broadcast address.

If a user's upstream DNS returns proper NXDOMAIN results and not bogus search page servers instead, there is no problem.

I'll push a workaround momentarily which comments out this line until we decide how best to proceed.

Associated revisions

Revision 378574a3
Added by Jim Pingle 9 months ago

Disable "setfirst" line in pfSense-dhclient-script for now. Ticket #7042

Revision af624840
Added by Luiz Souza 9 months ago

Instead of ignoring the IP, add it to interface even if we cannot do it with setfirst.

Ticket #7042

Revision 9bf81d66
Added by Luiz Souza 9 months ago

Revert "Instead of ignoring the IP, add it to interface even if we cannot do it with setfirst."

This reverts commit af6248407bae4d476b483dcb3a388744fb74b465.

Not necessary at all.

Pointy hat to: me
Ticket #7042

Revision e9de838d
Added by Luiz Souza 9 months ago

Implement a different method to obtain the 'main' IP (v4) for the interface.

The last interface IP is always saved in /var/db/${interface}_ip. Use that file, if it exist, to find the main interface IP.

The file is created by the same process and function that call 'ifconfig setfirst', so the presence of that file should produce a very similar behavior.

If the file does not exist, fallback to previous behavior (return the first IPv4 found on interface).

Ticket #7042

Revision da4d341e
Added by Luiz Souza 9 months ago

Remove the now unnecessary and commented code.

Ticket #7042

History

#1 Updated by Jim Pingle 9 months ago

Simplest way to reproduce this is to use a DNS Resolver override for "setfirst" and the firewall's domain, set to an obviously wrong address. Then all you have to do is unplug/replug the WAN cable, or reboot, and check the console menu or ifconfig output. It's easier to hit on SG-1000 for some reason, perhaps due to its lower speed.

#2 Updated by Jim Pingle 9 months ago

  • Assignee set to Luiz Souza

#3 Updated by Luiz Souza 9 months ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

#4 Updated by Jim Pingle 8 months ago

  • Status changed from Feedback to Resolved

Seems to be solid all-around.

Also available in: Atom PDF