dhcp: only register UDP ports that are needed 54/18554/3
authorMatthew Smith <mgsmith@netgate.com>
Wed, 27 Mar 2019 17:30:29 +0000 (12:30 -0500)
committerNeale Ranns <nranns@cisco.com>
Fri, 29 Mar 2019 08:19:25 +0000 (08:19 +0000)
When configuring a DHCP client, both the UDP ports for DHCP client
and server are registered. Packets to the server port end up being
dropped unless you have also configured a DHCP proxy.

This breaks a common home/office gateway use case where the WAN
interface gets configured using a DHCP client and devices attached
to a LAN interface attempt to configure themselves using DHCP. If
you try to punt to an external DHCP daemon to handle the LAN client
requests, the packets never make it to the external daemon because
of the server port being registered.

Modify dhcp_maybe_register_udp_ports() to accept a parameter that
controls which ports get registered. For a DHCP client, only the
client port is registered. For a DHCP proxy, both client and server
ports are registered.

Change-Id: I2182d9827e4c7424b03ebb94952c3d2dc37abdb6
Signed-off-by: Matthew Smith <mgsmith@netgate.com>

No differences found