mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-09-10 10:46:32 +00:00
netutils/dhcpc: Set close-on-exec by default to avoid udp_conn leak
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
0dc5e9f469
commit
cbcfe6be28
1 changed files with 1 additions and 1 deletions
|
|
@ -542,7 +542,7 @@ FAR void *dhcpc_open(FAR const char *interface, FAR const void *macaddr,
|
|||
|
||||
/* Create a UDP socket */
|
||||
|
||||
pdhcpc->sockfd = socket(PF_INET, SOCK_DGRAM, 0);
|
||||
pdhcpc->sockfd = socket(PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
|
||||
if (pdhcpc->sockfd < 0)
|
||||
{
|
||||
ninfo("socket handle %d\n", pdhcpc->sockfd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue