From owner-freebsd-net Tue Jan 8 13:40:39 2002 Delivered-To: freebsd-net@freebsd.org Received: from web12307.mail.yahoo.com (web12307.mail.yahoo.com [216.136.173.105]) by hub.freebsd.org (Postfix) with SMTP id CB9AB37B41C for ; Tue, 8 Jan 2002 13:40:35 -0800 (PST) Message-ID: <20020108214035.35901.qmail@web12307.mail.yahoo.com> Received: from [12.233.185.205] by web12307.mail.yahoo.com via HTTP; Tue, 08 Jan 2002 13:40:35 PST Date: Tue, 8 Jan 2002 13:40:35 -0800 (PST) From: Anand Narayanan Reply-To: anandn_98@yahoo.com Subject: Bug in in_pcbbind() with respect to SO_REUSEADDR/SO_REUSEPORT To: freebsd-net@FreeBSD.ORG MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-net@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-net" in the body of the message