From 7bb5c0f8ccb32bfb3603dfcc295f52978e6aef1c Mon Sep 17 00:00:00 2001 From: Jin-Seong Kim Date: Mon, 27 Mar 2017 16:59:32 +0900 Subject: [PATCH] netutils/dhcpd: specify port number when binding the socket This commit is to patch for specifying port number of dhcp server when binding the socket. If there is no port number specified, DHCP packets have wrong port number and this may cause interoperability problems during DHCP handshaking with various other platforms. Change-Id: Ife196fd1a524b2f3b4a0e1157ca28910d47ee8fd Signed-off-by: Jin-Seong Kim --- apps/netutils/dhcpd/dhcpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/netutils/dhcpd/dhcpd.c b/apps/netutils/dhcpd/dhcpd.c index b062dc5..7fcfbe8 100755 --- a/apps/netutils/dhcpd/dhcpd.c +++ b/apps/netutils/dhcpd/dhcpd.c @@ -858,7 +858,7 @@ static inline int dhcpd_openresponder(void) /* Bind the socket to a local port. */ addr.sin_family = AF_INET; - addr.sin_port = 0; + addr.sin_port = HTONS(DHCP_SERVER_PORT); addr.sin_addr.s_addr = g_state.ds_serverip; ret = bind(sockfd, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)); -- 2.7.4