Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Jan 2002 16:55:31 -0800 (PST)
From:      Anand Narayanan <anandn_98@yahoo.com>
To:        bugs@freebsd.org
Subject:   Possible bug in in_pcbbind wrt SO_REUSEPORT and SO_REUSEADDR
Message-ID:  <20020110005531.37053.qmail@web12305.mail.yahoo.com>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020110005531.37053.qmail>