From owner-freebsd-bugs Wed Jan 9 16:55:34 2002 Delivered-To: freebsd-bugs@freebsd.org Received: from web12305.mail.yahoo.com (web12305.mail.yahoo.com [216.136.173.103]) by hub.freebsd.org (Postfix) with SMTP id B767237B404 for ; Wed, 9 Jan 2002 16:55:31 -0800 (PST) Message-ID: <20020110005531.37053.qmail@web12305.mail.yahoo.com> Received: from [147.11.38.16] by web12305.mail.yahoo.com via HTTP; Wed, 09 Jan 2002 16:55:31 PST Date: Wed, 9 Jan 2002 16:55:31 -0800 (PST) From: Anand Narayanan Reply-To: anandn_98@yahoo.com Subject: Possible bug in in_pcbbind wrt SO_REUSEPORT and SO_REUSEADDR To: bugs@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi, This is an issue from in_pcb.c v 1.59.2.5 2000/08/16 06:14:23 I just encountered a problem in trying to bind a server address using the SO_REUSEPORT and SO_REUSEADDR option after the first one has been shutdown. Looking into in_pcbbind, I see that if SO_REUSEADDR or SO_REUSEPORT is set, then the variable "wild" is 0. if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0) wild = 1; However, when calling in_pcblookup_local (in the non-multicast case), it seems to ignore the value of wild. if (lport) { ... ... if (so->so_cred->cr_uid != 0 && !IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) { t = in_pcblookup_local(inp->inp_pcbinfo, sin->sin_addr, lport, prison ? 0 : INPLOOKUP_WILDCARD); Shouldn't the last argument to in_pcblookup_local be "wild" instead of INPLOOKUP_WILDCARD? By passing INPLOOKUP_WILDCARD, in_pcblookup_local always ignores the SO_REUSE* options and bind fails. Is this a bug or am I missing something? Any help would be appreciated. -Anand ===== __________________________________________________ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message