Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet netinet: Allow binding the unspecified address w...



details:   https://anonhg.NetBSD.org/src/rev/eb61c4619054
branches:  trunk
changeset: 1024337:eb61c4619054
user:      roy <roy%NetBSD.org@localhost>
date:      Tue Oct 19 20:01:09 2021 +0000

description:
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.

diffstat:

 sys/netinet/in_pcb.c |  6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diffs (27 lines):

diff -r 0c8f8f267312 -r eb61c4619054 sys/netinet/in_pcb.c
--- a/sys/netinet/in_pcb.c      Tue Oct 19 19:59:05 2021 +0000
+++ b/sys/netinet/in_pcb.c      Tue Oct 19 20:01:09 2021 +0000
@@ -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 <sys/cdefs.h>
-__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 @@
        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);
 



Home | Main Index | Thread Index | Old Index