Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jan 2013 14:16:07 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-net@freebsd.org
Cc:        Lawrence Stewart <lstewart@freebsd.org>, net@freebsd.org
Subject:   Re: [PATCH] Don't imply TCP and UDP socket options are bitmasks
Message-ID:  <201301151416.07231.jhb@freebsd.org>
In-Reply-To: <50F5181D.6020508@freebsd.org>
References:  <201301141550.13577.jhb@freebsd.org> <50F5181D.6020508@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday, January 15, 2013 3:49:33 am Lawrence Stewart wrote:
> On 01/15/13 07:50, John Baldwin wrote:
> > The constants used for TCP and UDP socket options (TCP_NODELAY, etc.) are 
> > currently defined as hex values that are individual bits.  However, socket 
> > options are never masked together, they are used as a simple enumeration of 
> > discrete values.  Using a bitmask forces us to run out of bits and makes it 
> > harder for vendors to try to use a high range of values for local custom 
> > options (hoping that they never conflict with a new option value added in 
> > stock FreeBSD).
> 
> Yup. Should we be explicitly #defining the boundary between "bits
> reserved for FreeBSD" and "bits for private vendor use"?

Oh, we could if you wanted.  I'm using 0x1000 locally for both TCP and UDP,
but those are completely arbitrary values.  Saner ones might be 0x8000000 if
we want to do that explicitly.  We could perhaps just say that is true for all
socket option levels (that is, just define one SO_VENDOR constant or some such
but say it applies to all levels)?

-- 
John Baldwin



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