IP_NONLOCALOK improvements.

Pawel Jakub Dawidek pjd at FreeBSD.org
Wed May 27 05:30:02 UTC 2009


On Tue, May 26, 2009 at 10:17:32PM -0700, Kip Macy wrote:
> On Tue, May 26, 2009 at 6:55 AM, Pawel Jakub Dawidek <pjd at freebsd.org> wrote:
> > Now that we have IP_NONLOCALOK IP socket option (which is something I
> > need a lot for my company's stuff) I started to hack on it a bit.
> >
> > OpenBSD has SO_BINDANY SOL_SOCKET option for some time now. So first of
> > all I wanted to do the same for FreeBSD. Unfortunately we ran out of
> > space in so_options - it is u_short and all possible values are already

Actually so_options is short, not u_short, sorry about that. The size
stays the same.

> > taken. As a side note there is SO_NO_DDP option that is used only in
> > cxgb driver and nowhere else. This seems like a waste of very important
> > bit (sonner or later someone will need yet another socket option).
> 
> Wouldn't now (before 8.0) be a good time to expand it beyond 16 bits
> rather than artificially restricting ourselves?

We can do that anyway. I'd prefer not to change it to SO_BINDANY,
because I'd like to MFC it and we won't be able to MFC so_options
enlargement. There is also an argument that this functionality more fits
as IP socket option than socket socket option.

We could do something more complex, though:
- Remove SO_NO_DDP from 7 (replace it with SO_BINDANY), as I don't see
  any users of SO_NO_DDP, at least in our tree.
- Expand so_options in HEAD and add SO_NO_DDP back.

But I'll left this for others to decide, as I might not be aware of the
consequences of so_options type change. All I know is that there are
places in the code that assume so_options is 16bit long (like
tw_so_options field in tcptw structure) and xsocket structure visible in
userland will also be changed.

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20090527/54d66a4b/attachment.pgp


More information about the freebsd-arch mailing list