From ca7d1a57f19769cec2290139b0c02ca9e6f99ac3 Mon Sep 17 00:00:00 2001 From: roy Date: Tue, 19 Oct 2021 20:01:09 +0000 Subject: [PATCH] netinet: Allow binding the unspecified address when no addresses exist You should always be able to bind to the unspecified address even if no addresses have been configured on any interface. For example, a DHCP client could be started before the loopback interface has been fully configured. --- sys/netinet/in_pcb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index c44686352d34..a3e0b87c311d 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1,4 +1,4 @@ -/* $NetBSD: in_pcb.c,v 1.185 2020/09/08 14:12:57 christos Exp $ */ +/* $NetBSD: in_pcb.c,v 1.186 2021/10/19 20:01:09 roy Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -93,7 +93,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.185 2020/09/08 14:12:57 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.186 2021/10/19 20:01:09 roy Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -436,8 +436,6 @@ in_pcbbind(void *v, struct sockaddr_in *sin, struct lwp *l) if (inp->inp_af != AF_INET) return (EINVAL); - if (IN_ADDRLIST_READER_EMPTY()) - return (EADDRNOTAVAIL); if (inp->inp_lport || !in_nullhost(inp->inp_laddr)) return (EINVAL);