aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/dhcp/client.c
diff options
context:
space:
mode:
authorMatthew Smith <mgsmith@netgate.com>2019-03-27 12:30:29 -0500
committerNeale Ranns <nranns@cisco.com>2019-03-29 08:19:25 +0000
commitd4bdd93f07b0acc15f84ec602532bc3dbab3c2bb (patch)
treeb0f1f7a996f9f9ea07ebc124c708f434f2ea9975 /src/vnet/dhcp/client.c
parentf20fd1ac904a68ee8e9099db1287b843fd00ee79 (diff)
dhcp: only register UDP ports that are needed
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>
Diffstat (limited to 'src/vnet/dhcp/client.c')
-rw-r--r--src/vnet/dhcp/client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vnet/dhcp/client.c b/src/vnet/dhcp/client.c
index 1c52b0cbdbb..aac3ad3eab6 100644
--- a/src/vnet/dhcp/client.c
+++ b/src/vnet/dhcp/client.c
@@ -907,7 +907,7 @@ dhcp_client_add_del (dhcp_client_add_del_args_t * a)
if (a->is_add)
{
- dhcp_maybe_register_udp_ports ();
+ dhcp_maybe_register_udp_ports (DHCP_PORT_REG_CLIENT);
pool_get (dcm->clients, c);
clib_memset (c, 0, sizeof (*c));
c->state = DHCP_DISCOVER;